feat: 完善 STEP/B-Rep 一级关系参数化编辑

This commit is contained in:
2026-08-07 18:08:32 +08:00
parent eef9efcc1e
commit 12250603dd
26 changed files with 4254 additions and 1270 deletions
+6 -12
View File
@@ -54,24 +54,18 @@ def main() -> int:
specs, _used = state._editable_property_specs(context)
rows = state._feature_context_property_specs(specs, context)
context_row = next((row for row in rows if row.get("key") == "feature_context_note"), None)
if context_row is None:
raise AssertionError("feature context should expose an associated-feature detection summary row")
context_text = str(context_row.get("current_text") or "")
context_scope = str(context_row.get("scope_text") or "")
if "相邻特征" not in context_text or "局部关联特征" not in context_text:
raise AssertionError(f"associated detection summary is not clear enough: {context_row}")
if "相邻特征" not in context_scope or "关联特征" not in context_scope:
raise AssertionError(f"associated detection summary should expose level and count: {context_row}")
if context_row is not None:
raise AssertionError("associated-feature detection summary should stay in diagnostics, not feature parameters")
editable = {
(str(row.get("label")), int(row.get("source_face_id", -1)), str(row.get("action")))
for row in rows
if row.get("parameter_role") == "dimension" and row.get("source_face_id") is not None
}
expected = {
("凸台/外圆候选 · 直径", 394, "resize_boss"),
("凸台/外圆候选 · 高度", 394, "resize_cylindrical_height_owning_scale"),
("圆柱孔候选 · 直径", 1591, "resize_hole"),
("圆柱孔候选 · 盲孔/盲槽深度", 1591, "resize_hole_depth"),
("凸台/外圆 · 直径", 394, "resize_boss"),
("凸台/外圆 · 高度", 394, "resize_cylindrical_height_owning_scale"),
("圆柱孔 · 直径", 1591, "resize_hole"),
("圆柱孔 · 盲孔/盲槽深度", 1591, "resize_hole_depth"),
}
if not expected.issubset(editable):
raise AssertionError(f"missing associated editable rows: {expected - editable}")