修复字段写错的bug
Browse files- README.md +5 -5
- README_EN.md +5 -5
- run_eval.py +2 -2
- src/prompts.py +174 -113
README.md
CHANGED
|
@@ -164,11 +164,11 @@ $$
|
|
| 164 |
|
| 165 |
## 📊 评测榜单 (Leaderboard)
|
| 166 |
|
| 167 |
-
| 模型 (Model) | 加权准确率 (Weighted Acc) |
|
| 168 |
-
| :--- | :---: | :---
|
| 169 |
-
| **Gemini-3-Pro-Preview** | **17.65%** |
|
| 170 |
-
| **GLM-4.5V** | 16.18% |
|
| 171 |
-
| **Qwen3-VL-32B-Instruct** | 13.24% |
|
| 172 |
|
| 173 |
*注:数据更新于 2026-01-31,基于 v1.0 数据集 (20题).*
|
| 174 |
|
|
|
|
| 164 |
|
| 165 |
## 📊 评测榜单 (Leaderboard)
|
| 166 |
|
| 167 |
+
| 模型 (Model) | 加权准确率 (Weighted Acc) | 备注 (Notes) |
|
| 168 |
+
| :--- | :---: | :--- |
|
| 169 |
+
| **Gemini-3-Pro-Preview** | **17.65%** | Retries: 3 |
|
| 170 |
+
| **GLM-4.5V** | 16.18% | Retries: 3 |
|
| 171 |
+
| **Qwen3-VL-32B-Instruct** | 13.24% | Retries: 3 |
|
| 172 |
|
| 173 |
*注:数据更新于 2026-01-31,基于 v1.0 数据集 (20题).*
|
| 174 |
|
README_EN.md
CHANGED
|
@@ -143,11 +143,11 @@ $$
|
|
| 143 |
|
| 144 |
## 📊 Leaderboard
|
| 145 |
|
| 146 |
-
| Model | Weighted Accuracy |
|
| 147 |
-
| :--- | :---: | :---
|
| 148 |
-
| **Gemini-3-Pro-Preview** | **17.65%** |
|
| 149 |
-
| **GLM-4.5V** | 16.18% |
|
| 150 |
-
| **Qwen3-VL-32B-Instruct** | 13.24% |
|
| 151 |
|
| 152 |
*Note: Data updated on 2026-01-31, based on v1.0 dataset (20 tasks).*
|
| 153 |
|
|
|
|
| 143 |
|
| 144 |
## 📊 Leaderboard
|
| 145 |
|
| 146 |
+
| Model | Weighted Accuracy | Notes |
|
| 147 |
+
| :--- | :---: | :--- |
|
| 148 |
+
| **Gemini-3-Pro-Preview** | **17.65%** | Retries: 3 |
|
| 149 |
+
| **GLM-4.5V** | 16.18% | Retries: 3 |
|
| 150 |
+
| **Qwen3-VL-32B-Instruct** | 13.24% | Retries: 3 |
|
| 151 |
|
| 152 |
*Note: Data updated on 2026-01-31, based on v1.0 dataset (20 tasks).*
|
| 153 |
|
run_eval.py
CHANGED
|
@@ -110,7 +110,7 @@ def apply_standard_load(model):
|
|
| 110 |
"wStart": 10,
|
| 111 |
"wEnd": 10,
|
| 112 |
"angleDeg": 270, # 向下
|
| 113 |
-
"angleMode": "
|
| 114 |
})
|
| 115 |
return model
|
| 116 |
|
|
@@ -409,4 +409,4 @@ def main():
|
|
| 409 |
print(f"Results saved to {output_filename}")
|
| 410 |
|
| 411 |
if __name__ == "__main__":
|
| 412 |
-
main()
|
|
|
|
| 110 |
"wStart": 10,
|
| 111 |
"wEnd": 10,
|
| 112 |
"angleDeg": 270, # 向下
|
| 113 |
+
"angleMode": "world"
|
| 114 |
})
|
| 115 |
return model
|
| 116 |
|
|
|
|
| 409 |
print(f"Results saved to {output_filename}")
|
| 410 |
|
| 411 |
if __name__ == "__main__":
|
| 412 |
+
main()
|
src/prompts.py
CHANGED
|
@@ -4,23 +4,44 @@
|
|
| 4 |
# 1. 标准模式 (Standard)
|
| 5 |
# ==============================================================================
|
| 6 |
PROMPT_STANDARD = """
|
| 7 |
-
You are a structural engineering expert.
|
| 8 |
-
Convert the 2D image into FEA JSON.
|
| 9 |
|
| 10 |
### JSON Output Schema
|
| 11 |
<json>
|
| 12 |
{
|
| 13 |
-
"points": [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"links": [
|
| 15 |
{
|
| 16 |
-
"id": "L1", "a": "P1", "b": "P2",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850
|
| 18 |
}
|
| 19 |
],
|
| 20 |
-
"supports": [
|
|
|
|
|
|
|
|
|
|
| 21 |
"loads": [
|
| 22 |
{
|
| 23 |
"id": "LD1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
"kind": "distributedLoad",
|
| 25 |
"at": {"type": "link", "id": "L1"},
|
| 26 |
"wStart": 10,
|
|
@@ -30,126 +51,132 @@ Convert the 2D image into FEA JSON.
|
|
| 30 |
"angleMode": "world",
|
| 31 |
"angleDeg": 270,
|
| 32 |
"flip": 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
]
|
| 35 |
}
|
| 36 |
</json>
|
| 37 |
|
| 38 |
### Rules
|
| 39 |
-
1. **CONNECTIVITY IS MANDATORY:**
|
| 40 |
-
- Every Point MUST be connected to at least one Link.
|
| 41 |
- No "floating" or "orphan" nodes allowed (e.g., do not define P3 if it is not part of any Link).
|
| 42 |
- Ensure the entire structure forms a single connected graph.
|
| 43 |
-
2. **LINK ENDS:**
|
| 44 |
-
- **
|
| 45 |
-
- **
|
| 46 |
-
- **
|
| 47 |
-
- **
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
4. **
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
- `"
|
| 55 |
-
- `"
|
| 56 |
-
-
|
| 57 |
-
|
| 58 |
-
- **
|
|
|
|
| 59 |
- **Target (`at`):** Can be `{"type": "point", "id": "P1"}` or `{"type": "link", "id": "L1"}`.
|
| 60 |
-
- `kind: "pointLoad"`: Use `value`, `angleDeg`, `angleMode`, `flip`.
|
| 61 |
-
- `kind: "distributedLoad"`: Use `wStart`, `wEnd`, `fromStart`, `fromEnd`, `angleDeg`, `angleMode`, `flip`.
|
| 62 |
-
- `kind: "bendingMoment"`: Use `value`, `flip` (**-1: Clockwise, 1: Counter-Clockwise**). (NO angle fields).
|
| 63 |
-
- **Link-Specific:** If `at` is a `link`, `pointLoad` and `bendingMoment` MUST include:
|
| 64 |
-
- `offset` (meters)
|
| 65 |
-
- `offsetMode` ("
|
| 66 |
- `offsetPercent` (required if `offsetMode` is "percent")
|
| 67 |
- `refEnd` ("A" or "B")
|
| 68 |
-
- **AngleMode:** Use "world".
|
| 69 |
- **Flip:** Must be 1 or -1.
|
| 70 |
-
|
| 71 |
-
-
|
| 72 |
-
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
"""
|
| 77 |
|
| 78 |
# ==============================================================================
|
| 79 |
# 2. 推理/高阶模式 (Reasoning/CoT)
|
| 80 |
# ==============================================================================
|
| 81 |
-
PROMPT_REASONING = """You are a "Structural Image → JSON" converter.
|
| 82 |
|
| 83 |
-
# CORE STRATEGY: CONNECTIVITY & TOPOLOGY
|
| 84 |
|
| 85 |
-
1. **NO ORPHAN NODES:**
|
| 86 |
-
*
|
| 87 |
-
*
|
| 88 |
-
*
|
| 89 |
|
| 90 |
-
2. **
|
| 91 |
-
-
|
| 92 |
-
- **
|
| 93 |
-
- **
|
| 94 |
-
- **
|
|
|
|
| 95 |
|
| 96 |
-
3. **
|
| 97 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
- **Do NOT use `"hinge"` as a support kind.**
|
| 99 |
|
| 100 |
-
|
| 101 |
-
*
|
| 102 |
-
*
|
| 103 |
-
*
|
| 104 |
-
*
|
| 105 |
-
*
|
|
|
|
| 106 |
|
| 107 |
-
|
| 108 |
-
*
|
| 109 |
-
*
|
| 110 |
-
*
|
| 111 |
|
| 112 |
-
# DATA DEFINITIONS
|
| 113 |
-
- **Units:** Forces in **kN**, Distributed loads in **kN/m**, Moments in **kN·m**. Use small values (e.g., 10, not 10000).
|
| 114 |
-
- **
|
| 115 |
-
- **
|
| 116 |
|
| 117 |
# OUTPUT FORMAT
|
| 118 |
<think>
|
| 119 |
-
1. **
|
| 120 |
-
2. **
|
| 121 |
-
3. **
|
|
|
|
|
|
|
| 122 |
</think>
|
| 123 |
<json> ... </json>
|
| 124 |
-
|
| 125 |
-
<think>
|
| 126 |
-
* Nodes: P1(0,0), P2(5,0), P3(10,0).
|
| 127 |
-
* Connectivity Check:
|
| 128 |
-
- L1 connects P1-P2.
|
| 129 |
-
- L2 connects P2-P3.
|
| 130 |
-
- All nodes (P1, P2, P3) are used. Structure is continuous.
|
| 131 |
-
* Joint P2: Rigid continuous connection.
|
| 132 |
-
* Supports: P1(Pin), P3(Roller).
|
| 133 |
-
</think>
|
| 134 |
-
|
| 135 |
-
<json>
|
| 136 |
-
{
|
| 137 |
-
"points": [
|
| 138 |
-
{ "id": "P1", "x": 0, "y": 0 },
|
| 139 |
-
{ "id": "P2", "x": 5, "y": 0 },
|
| 140 |
-
{ "id": "P3", "x": 10, "y": 0 }
|
| 141 |
-
],
|
| 142 |
-
"links": [
|
| 143 |
-
{ "id": "L1", "a": "P1", "b": "P2", "endA": "rigid", "endB": "rigid", "E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850 },
|
| 144 |
-
{ "id": "L2", "a": "P2", "b": "P3", "endA": "rigid", "endB": "rigid", "E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850 }
|
| 145 |
-
],
|
| 146 |
-
"supports": [
|
| 147 |
-
{ "id": "S1", "at": { "type": "point", "id": "P1" }, "kind": "pin", "angleDeg": 0 },
|
| 148 |
-
{ "id": "S2", "at": { "type": "point", "id": "P3" }, "kind": "roller", "angleDeg": 0 }
|
| 149 |
-
],
|
| 150 |
-
"loads": []
|
| 151 |
-
}
|
| 152 |
-
</json>"""
|
| 153 |
|
| 154 |
# ==============================================================================
|
| 155 |
# 3. 严格模式 (Strict)
|
|
@@ -158,26 +185,60 @@ PROMPT_STRICT = """
|
|
| 158 |
Output structural JSON inside <json> tags.
|
| 159 |
|
| 160 |
**STRICT RULES:**
|
| 161 |
-
1. **CONNECTIVITY:** Every Point MUST connect to a Link. No orphan nodes.
|
| 162 |
-
2. **
|
| 163 |
-
3. **
|
| 164 |
-
4. **
|
| 165 |
-
5. **
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
- `kind: "
|
| 169 |
-
- `kind: "
|
| 170 |
-
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
| 174 |
|
| 175 |
<json>
|
| 176 |
{
|
| 177 |
-
"points": [
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
}
|
| 182 |
</json>
|
| 183 |
"""
|
|
@@ -190,4 +251,4 @@ PROMPT_REGISTRY = {
|
|
| 190 |
"reasoning": PROMPT_REASONING,
|
| 191 |
"cot": PROMPT_REASONING,
|
| 192 |
"strict": PROMPT_STRICT
|
| 193 |
-
}
|
|
|
|
| 4 |
# 1. 标准模式 (Standard)
|
| 5 |
# ==============================================================================
|
| 6 |
PROMPT_STANDARD = """
|
| 7 |
+
You are a structural engineering expert (结构工程专家).
|
| 8 |
+
Convert the 2D image into FEA JSON (有限元分析JSON).
|
| 9 |
|
| 10 |
### JSON Output Schema
|
| 11 |
<json>
|
| 12 |
{
|
| 13 |
+
"points": [
|
| 14 |
+
{"id": "P1", "x": 0, "y": 0},
|
| 15 |
+
{"id": "P2", "x": 6, "y": 0},
|
| 16 |
+
{"id": "P3", "x": 3, "y": 4}
|
| 17 |
+
],
|
| 18 |
"links": [
|
| 19 |
{
|
| 20 |
+
"id": "L1", "a": "P1", "b": "P2",
|
| 21 |
+
"endA": "rigid", "endB": "rigid",
|
| 22 |
+
"E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"id": "L2", "a": "P2", "b": "P3",
|
| 26 |
"E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850
|
| 27 |
}
|
| 28 |
],
|
| 29 |
+
"supports": [
|
| 30 |
+
{"id": "S1", "at": {"type": "point", "id": "P1"}, "kind": "pin", "angleDeg": 0},
|
| 31 |
+
{"id": "S2", "at": {"type": "point", "id": "P3"}, "kind": "roller", "angleDeg": 0}
|
| 32 |
+
],
|
| 33 |
"loads": [
|
| 34 |
{
|
| 35 |
"id": "LD1",
|
| 36 |
+
"kind": "pointLoad",
|
| 37 |
+
"at": {"type": "point", "id": "P2"},
|
| 38 |
+
"value": 20,
|
| 39 |
+
"angleMode": "world",
|
| 40 |
+
"angleDeg": 270,
|
| 41 |
+
"flip": 1
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"id": "LD2",
|
| 45 |
"kind": "distributedLoad",
|
| 46 |
"at": {"type": "link", "id": "L1"},
|
| 47 |
"wStart": 10,
|
|
|
|
| 51 |
"angleMode": "world",
|
| 52 |
"angleDeg": 270,
|
| 53 |
"flip": 1
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"id": "LD3",
|
| 57 |
+
"kind": "pointLoad",
|
| 58 |
+
"at": {"type": "link", "id": "L1"},
|
| 59 |
+
"value": 8,
|
| 60 |
+
"angleMode": "relative",
|
| 61 |
+
"angleDeg": 270,
|
| 62 |
+
"flip": 1,
|
| 63 |
+
"refEnd": "A",
|
| 64 |
+
"offsetMode": "percent",
|
| 65 |
+
"offsetPercent": 50,
|
| 66 |
+
"offset": 3
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"id": "LD4",
|
| 70 |
+
"kind": "bendingMoment",
|
| 71 |
+
"at": {"type": "link", "id": "L2"},
|
| 72 |
+
"value": 12,
|
| 73 |
+
"flip": -1,
|
| 74 |
+
"refEnd": "A",
|
| 75 |
+
"offsetMode": "m",
|
| 76 |
+
"offset": 1.5
|
| 77 |
}
|
| 78 |
]
|
| 79 |
}
|
| 80 |
</json>
|
| 81 |
|
| 82 |
### Rules
|
| 83 |
+
1. **CONNECTIVITY IS MANDATORY (连通性为强制要求):** - Every Point (节点) MUST be connected to at least one Link (杆件).
|
|
|
|
| 84 |
- No "floating" or "orphan" nodes allowed (e.g., do not define P3 if it is not part of any Link).
|
| 85 |
- Ensure the entire structure forms a single connected graph.
|
| 86 |
+
2. **LINK ENDS & TRUSS OVERRIDE (杆件端点约束与桁架覆盖规则 - 关键):**
|
| 87 |
+
- **TRUSS OVERRIDE (纯桁架覆盖):** If the image is a pure truss (桁架 - a triangulated framework with loads only at joints / 仅在节点受力的三角框架), IGNORE all visual hinge circles (忽略图中所有铰接圆圈). **Prefer omitting `"endA"`/`"endB"` for all links; if you keep them, both must be `"rigid"` (优先省略 endA/endB;若保留,必须两端均为 rigid).**
|
| 88 |
+
- **Default (Non-Truss / 非桁架默认):** `rigid-rigid` (刚接-刚接). You CAN OMIT the `"endA"` and `"endB"` fields if both ends are rigid (如果两端均为刚接,允许完全省略这两个字段).
|
| 89 |
+
- **Hinge Circles (铰接圆圈):** If a link ends at a hinge circle (在框架/梁中的铰接点), set that end to `hinge` (铰接).
|
| 90 |
+
- **Allowed Combinations (允许的组合):** `rigid-rigid` (刚接), `rigid-hinge` (刚接-铰接), `hinge-rigid` (铰接-刚接).
|
| 91 |
+
- **FORBIDDEN (严禁):** `hinge-hinge` (两端均为铰接) is NOT allowed.
|
| 92 |
+
3. **IGNORE ANNOTATIONS (忽略文字标注):** Ignore text labels, letters (e.g., "X", "A", "B"), or cut-lines indicating textbook questions ("solve for internal force of member X" / 求解某杆件内力等截断线). Do NOT model them as structural links (不要将标注建模为结构杆件).
|
| 93 |
+
4. **JOINT LOGIC (节点逻辑):** If N links meet at a hinge circle (N根杆交于一铰接点), set `hinge` for N-1 links (keep 1 rigid to stabilize / 保持1根刚接以维持稳定).
|
| 94 |
+
- **Split Rule (拆分规则):** If a hinge exists along a member with a distributed load (如果在带有均布荷载的杆件中间出现铰接), **SPLIT** the member into two Links (将杆件拆分为两根) and **SPLIT** the load into two separate `distributedLoad` entries (将荷载拆分为两段).
|
| 95 |
+
5. **NO HINGES AT SUPPORTS (支座处无铰接):** Link ends at supports MUST be `rigid` (连接到支座的杆件端点必须为刚接).
|
| 96 |
+
6. **SUPPORTS (支座):** Allowed `kind` values are:
|
| 97 |
+
- `"pin"`: Pinned support (固定铰支座, UX, UY restricted / 限制水平和竖向位移).
|
| 98 |
+
- `"roller"`: Roller support (滚动支座/可动铰支座, UY restricted if angle is 0. For vertical wall, use 90 or 270).
|
| 99 |
+
- `"fixed"`: Fixed/Cantilever support (固定端支座/悬臂端, UX, UY, RZ restricted / 限制所有位移和转角).
|
| 100 |
+
- `"slider"`: Slider support (滑动导向支座/定向支座, UX, RZ restricted).
|
| 101 |
+
- **Note:** Do NOT use `"hinge"` as a support `kind`. Use `"pin"` instead (严禁用 "hinge" 作为支座类型,请使用 "pin").
|
| 102 |
+
7. **LOADS (荷载):** - **MUST use `kind` (NOT `type`).** IDs must start with "LD" (e.g., "LD1"). Do NOT add random fields. Optional `angleWorldDeg` is allowed when `angleMode` is `"world"`.
|
| 103 |
- **Target (`at`):** Can be `{"type": "point", "id": "P1"}` or `{"type": "link", "id": "L1"}`.
|
| 104 |
+
- `kind: "pointLoad"` (集中力/集中荷载): Use `value`, `angleDeg`, `angleMode` ("relative" or "world"), `flip`. (Downward point loads MUST be `angleDeg: 270` if using "world" / 若使用world坐标系,竖直向下必须为 270).
|
| 105 |
+
- `kind: "distributedLoad"` (均布荷载): Use `wStart`, `wEnd`, `fromStart`, `fromEnd`, `angleDeg`, `angleMode` ("relative" or "world"), `flip`.
|
| 106 |
+
- `kind: "bendingMoment"` (弯矩/集中偶矩): Use `value`, `flip` (**-1: Clockwise / 顺时针, 1: Counter-Clockwise / 逆时针**). (NO angle fields).
|
| 107 |
+
- **Link-Specific (作用于杆件上的荷载):** If `at` is a `link`, `pointLoad` and `bendingMoment` MUST include:
|
| 108 |
+
- `offset` (偏移量, meters)
|
| 109 |
+
- `offsetMode` ("m" or "percent")
|
| 110 |
- `offsetPercent` (required if `offsetMode` is "percent")
|
| 111 |
- `refEnd` ("A" or "B")
|
|
|
|
| 112 |
- **Flip:** Must be 1 or -1.
|
| 113 |
+
8. **UNITS (单位):** - Forces (力): **kN** (e.g., 10, not 10000).
|
| 114 |
+
- Distributed Loads (均布荷载): **kN/m**.
|
| 115 |
+
- Moments (弯矩): **kN·m**.
|
| 116 |
+
9. **Properties & Multipliers (截面属性与刚度倍数):** Base values: "E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850.
|
| 117 |
+
- **CRITICAL:** If a link explicitly shows a stiffness multiplier in the image (e.g., "2EI", "3EA"), you MUST multiply the base property by that factor (e.g., For "2EI", output `"E": 161836000`). (如果图中杆件标有 2EI、3EA 等刚度倍数,必须将基准值乘以对应倍数).
|
| 118 |
+
10. **STRICT JSON VALUES (严格JSON值):** Do NOT include comments (e.g., // or /* */) inside the JSON. ALL values must be final computed numbers (e.g., `8.66`). Do NOT output math formulas, fractions, or trigonometric functions (like `10*cos(30)`, `sin`, `sqrt`) inside the JSON (JSON内严禁出现推导过程、数学公式或sin/cos等三角函数,必须直接输出最终计算得出的纯数字). Standard JSON only.
|
| 119 |
"""
|
| 120 |
|
| 121 |
# ==============================================================================
|
| 122 |
# 2. 推理/高阶模式 (Reasoning/CoT)
|
| 123 |
# ==============================================================================
|
| 124 |
+
PROMPT_REASONING = """You are a "Structural Image → JSON" converter (结构图纸到JSON的转换专家).
|
| 125 |
|
| 126 |
+
# CORE STRATEGY: CONNECTIVITY & TOPOLOGY (核心策略:连通性与拓扑)
|
| 127 |
|
| 128 |
+
1. **NO ORPHAN NODES (禁止孤立节点):**
|
| 129 |
+
* **Rule:** Every Point ID defined in `"points"` MUST appear as either `a` or `b` in the `"links"` array.
|
| 130 |
+
* **Check:** Do not create intermediate points (like P2, P3) if they are just floating in space. They must connect members (节点必须用于连接杆件).
|
| 131 |
+
* **Structure:** The final result must be a single coherent structure, not disjoint parts.
|
| 132 |
|
| 133 |
+
2. **LINK ENDS & TRUSS OVERRIDE (杆件端点与桁架覆盖):**
|
| 134 |
+
- **Pure Truss Override (纯桁架覆盖):** For trusses (桁架), IGNORE ALL visual hinges. **Prefer omitting `"endA"` and `"endB"`; if present, both must be `"rigid"`** (优先省略;若保留,两端必须 rigid).
|
| 135 |
+
- **General Default (一般默认):** `rigid-rigid` (刚接-刚接). You CAN OMIT `"endA"` and `"endB"` if both ends are rigid.
|
| 136 |
+
- **Explicit Hinges (明确的铰接点):** Use `rigid-hinge` or `hinge-rigid`.
|
| 137 |
+
- **Constraint (限制):** `hinge-hinge` (两端全铰接) is **FORBIDDEN**.
|
| 138 |
+
- **Support Ends (支座连接端):** ALWAYS Rigid (必须为刚接).
|
| 139 |
|
| 140 |
+
3. **JOINT LOGIC (节点铰接逻辑,非桁架):**
|
| 141 |
+
- If N links meet at one hinge circle, set `hinge` on N-1 links and keep 1 link `rigid` for stability (N根杆汇交于同一铰点时,N-1 根设为 hinge,保留 1 根 rigid 以维持稳定).
|
| 142 |
+
|
| 143 |
+
4. **IGNORE ANNOTATIONS (忽略图纸标注):** - Letters (like "X", "A", "B"), text, or cut-lines (截断线) are textbook markers. DO NOT model them as physical links (切勿建模为物理杆件).
|
| 144 |
+
|
| 145 |
+
5. **GEOMETRY DEDUCTION (几何推导):**
|
| 146 |
+
- In `<think>`, mathematically deduce node coordinates (推导节点坐标). Use dimensions (e.g., total length 8m) and angles (e.g., 45° implies width = height) to calculate exact (x,y) values.
|
| 147 |
+
|
| 148 |
+
6. **SUPPORTS (支座类型):** Allowed `kind` values are:
|
| 149 |
+
- `"pin"` (固定铰支座), `"roller"` (滚动支座/可动铰支座), `"fixed"` (固定端支座), `"slider"` (滑动导向支座/定向支座).
|
| 150 |
- **Do NOT use `"hinge"` as a support kind.**
|
| 151 |
|
| 152 |
+
7. **LOAD SCHEMA (荷载规范 - 严格):**
|
| 153 |
+
* **MUST use `kind` (NOT `type`).** IDs must start with "LD" (e.g., "LD1"). Do NOT add random fields. Optional `angleWorldDeg` is allowed when `angleMode` is `"world"`.
|
| 154 |
+
* `kind: "pointLoad"` (集中力): Fields `id`, `kind`, `at`, `value`, `angleMode` ("relative" or "world"), `angleDeg` (Downward/向下 = 270 if "world"), `flip` (1/-1).
|
| 155 |
+
* `kind: "distributedLoad"` (均布荷载): Fields `id`, `kind`, `at`, `wStart`, `wEnd`, `fromStart`, `fromEnd`, `angleMode` ("relative" or "world"), `angleDeg`, `flip` (1/-1).
|
| 156 |
+
* `kind: "bendingMoment"` (弯矩): Fields `id`, `kind`, `at`, `value`, `flip` (-1: CW / 顺时针, 1: CCW / 逆时针).
|
| 157 |
+
* Link-target `pointLoad` / `bendingMoment` (杆件受集中力/弯矩): add `refEnd`, `offset`, `offsetMode` (`"m"` or `"percent"`), and `offsetPercent` when `offsetMode` is `"percent"`.
|
| 158 |
+
* `fromStart` / `fromEnd` are for `distributedLoad` only.
|
| 159 |
|
| 160 |
+
8. **SPLIT AT HINGES (在中间铰接处拆分):**
|
| 161 |
+
* If a hinge is located in the middle of a beam (若梁中间出现铰接):
|
| 162 |
+
* **Split the Link (拆分杆件):** Create two links meeting at the hinge point.
|
| 163 |
+
* **Split the Load (拆分荷载):** Create two `distributedLoad` entries (one for each link).
|
| 164 |
|
| 165 |
+
# DATA DEFINITIONS (数据定义)
|
| 166 |
+
- **Units (单位):** Forces in **kN** (力), Distributed loads in **kN/m** (均布荷载), Moments in **kN·m** (弯矩). Use small values (e.g., 10, not 10000).
|
| 167 |
+
- **Properties & Multipliers (截���属性与刚度倍数):** Base values: E: 80918000, A: 0.00785398, Iz: 0.00000491, density: 7850. **Multiply base values if the image shows multipliers like "2EI" (e.g., E becomes 161836000)**.
|
| 168 |
+
- **Strict JSON Values (严格JSON值):** JSON must be strict. No // comments. ALL values must be final computed numbers. NO math expressions (e.g., `10*cos(30)`, `sin`) inside the JSON (JSON内严禁出现推导过程、公式或sin/cos,仅允许填写最终计算出来的纯数字).
|
| 169 |
|
| 170 |
# OUTPUT FORMAT
|
| 171 |
<think>
|
| 172 |
+
1. **Geometry:** Deduce coordinates mathematically (计算坐标).
|
| 173 |
+
2. **Nodes:** List coordinates. Verify every node is part of a link.
|
| 174 |
+
3. **Ignore Labels:** Exclude textbook cut-lines or "X" marks.
|
| 175 |
+
4. **Links:** Define connections. For pure truss, prefer omitting end fields; if kept, use rigid-rigid only. Ensure P_start to P_end connectivity. Multiply EI/EA if needed.
|
| 176 |
+
5. **Supports/Loads:** Add boundary conditions (添加边界条件与荷载).
|
| 177 |
</think>
|
| 178 |
<json> ... </json>
|
| 179 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
# ==============================================================================
|
| 182 |
# 3. 严格模式 (Strict)
|
|
|
|
| 185 |
Output structural JSON inside <json> tags.
|
| 186 |
|
| 187 |
**STRICT RULES:**
|
| 188 |
+
1. **CONNECTIVITY (连通性):** Every Point MUST connect to a Link. No orphan nodes (禁止孤立节点).
|
| 189 |
+
2. **TRUSS OVERRIDE (桁架覆盖):** For pure trusses (纯桁架), IGNORE visual hinges. **Prefer omitting `"endA"` and `"endB"`; if present, both must be `"rigid"`** (优先省略;若保留,两端必须 rigid).
|
| 190 |
+
3. **LINKS (非桁架杆件):** Default `rigid-rigid` (刚接, **CAN OMIT `"endA"` and `"endB"`** if both are rigid). Use `rigid-hinge` or `hinge-rigid` for valid hinge circles (铰接点). **NO `hinge-hinge` (严禁两端铰接).**
|
| 191 |
+
4. **JOINT LOGIC (节点铰接逻辑,非桁架):** If N links meet at one hinge circle, set `hinge` on N-1 links and keep 1 link `rigid` (N根杆交于同一铰点时,N-1 根设为 hinge,保留 1 根 rigid). Split links/loads at internal hinges (若梁中间有铰接必须将杆件和荷载拆分).
|
| 192 |
+
5. **IGNORE LABELS (忽略标注):** Ignore "X" marks, letters, and cut-lines. They are not structural members.
|
| 193 |
+
6. **SUPPORTS (支座):** Link ends at supports MUST be `rigid`. Allowed kinds: `pin` (固定铰支座), `roller` (滚动支座/可动铰支座), `fixed` (固定端支座), `slider` (滑动导向支座/定向支座). **NO `hinge` (严禁使用hinge作为支座).**
|
| 194 |
+
7. **LOADS (荷载):** - **MUST use `kind` (NOT `type`).** IDs must start with "LD". Do NOT add random fields. Optional `angleWorldDeg` is allowed when `angleMode` is `"world"`.
|
| 195 |
+
- `kind: "pointLoad"` (集中力): Use `value`, `angleDeg`, `angleMode` ("relative" or "world"), `flip` (1 or -1). Downward (向下) = 270° if "world".
|
| 196 |
+
- `kind: "distributedLoad"` (均布荷载): Use `wStart`, `wEnd`, `fromStart`, `fromEnd`, `angleDeg`, `angleMode` ("relative" or "world"), `flip` (1 or -1).
|
| 197 |
+
- `kind: "bendingMoment"` (弯矩): Use `value`, `flip` (-1: Clockwise / 顺时针, 1: Counter-Clockwise / 逆时针).
|
| 198 |
+
- **Link Loads (杆上荷载):** If `at.type` is "link", `pointLoad`/`bendingMoment` MUST have `offset` (偏移量), `offsetMode` ("m" or "percent"), `refEnd` ("A"/"B"), and `offsetPercent` when `offsetMode` is "percent".
|
| 199 |
+
8. **UNITS (单位):** Forces: **kN**, Distributed: **kN/m**, Moments: **kN·m**.
|
| 200 |
+
9. **PROPERTIES & MULTIPLIERS:** Base "E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850. **Multiply base property if labeled (e.g., "2EI" -> E=161836000)**.
|
| 201 |
+
10. **STRICT JSON VALUES (严格JSON值):** Standard JSON only. No // or /* */ allowed. Values MUST be final computed numbers. NO math formulas or expressions (e.g., `sin`, `cos`, `10*1.5`) inside the JSON (严禁在JSON内写推导过程或数学公式,必须是最终得出的纯数字).
|
| 202 |
|
| 203 |
<json>
|
| 204 |
{
|
| 205 |
+
"points": [
|
| 206 |
+
{"id": "P1", "x": 0, "y": 0},
|
| 207 |
+
{"id": "P2", "x": 8, "y": 0}
|
| 208 |
+
],
|
| 209 |
+
"links": [
|
| 210 |
+
{"id": "L1", "a": "P1", "b": "P2", "E": 80918000, "A": 0.00785398, "Iz": 0.00000491, "density": 7850}
|
| 211 |
+
],
|
| 212 |
+
"supports": [
|
| 213 |
+
{"id": "S1", "at": {"type": "point", "id": "P1"}, "kind": "pin", "angleDeg": 0},
|
| 214 |
+
{"id": "S2", "at": {"type": "point", "id": "P2"}, "kind": "roller", "angleDeg": 0}
|
| 215 |
+
],
|
| 216 |
+
"loads": [
|
| 217 |
+
{
|
| 218 |
+
"id": "LD1",
|
| 219 |
+
"kind": "distributedLoad",
|
| 220 |
+
"at": {"type": "link", "id": "L1"},
|
| 221 |
+
"wStart": 10,
|
| 222 |
+
"wEnd": 10,
|
| 223 |
+
"fromStart": 0,
|
| 224 |
+
"fromEnd": 0,
|
| 225 |
+
"angleMode": "world",
|
| 226 |
+
"angleDeg": 270,
|
| 227 |
+
"flip": 1
|
| 228 |
+
},
|
| 229 |
+
{
|
| 230 |
+
"id": "LD2",
|
| 231 |
+
"kind": "pointLoad",
|
| 232 |
+
"at": {"type": "link", "id": "L1"},
|
| 233 |
+
"value": 5,
|
| 234 |
+
"angleMode": "relative",
|
| 235 |
+
"angleDeg": 270,
|
| 236 |
+
"flip": 1,
|
| 237 |
+
"refEnd": "A",
|
| 238 |
+
"offsetMode": "m",
|
| 239 |
+
"offset": 3
|
| 240 |
+
}
|
| 241 |
+
]
|
| 242 |
}
|
| 243 |
</json>
|
| 244 |
"""
|
|
|
|
| 251 |
"reasoning": PROMPT_REASONING,
|
| 252 |
"cot": PROMPT_REASONING,
|
| 253 |
"strict": PROMPT_STRICT
|
| 254 |
+
}
|