feat: 完善 STEP 编辑器最小系统和稳定性

This commit is contained in:
2026-07-28 14:05:14 +08:00
parent 26216064e0
commit 7c263d1e96
19 changed files with 3173 additions and 931 deletions
+12 -5
View File
@@ -374,8 +374,8 @@ class StepModel(FeatureMixin, ExportMixin, TransformMixin, OperationMixin, Polyd
"feature_face_ids": (face_id,),
"feature_highlight_face_ids": (face_id,),
"feature_boundary_edge_ids": tuple(boundary_edge_ids),
"feature_edit_actions": "当前第一版只能查看该局部曲面,暂不支持直接编辑。",
"feature_mode": "Feature 模式会把选中的 face 解释为局部几何特征候选。",
"feature_edit_actions": "当前版只能查看该局部曲面,暂不支持直接编辑。",
"feature_mode": "Feature 模式会把选中的Face解释为局部几何特征候选。",
}
)
return result
@@ -390,7 +390,7 @@ class StepModel(FeatureMixin, ExportMixin, TransformMixin, OperationMixin, Polyd
scope_note = "当前 face 没有检测到可一起推拉的共面相接/重叠邻居。"
edit_actions = "推拉平面"
if shell_info.get("shell_region_status") == "candidate":
edit_actions += "查看薄壁/壳体厚度估算"
edit_actions += "调整薄壁/壳体厚度"
result = dict(info)
result.update(
{
@@ -493,6 +493,7 @@ class StepModel(FeatureMixin, ExportMixin, TransformMixin, OperationMixin, Polyd
best = {
"shell_opposite_face_id": candidate_id,
"shell_thickness_estimate": thickness,
"shell_signed_thickness": _axis_parameter(plane.Location(), normal, candidate_plane.Location()),
"shell_overlap_ratio_estimate": overlap_ratio,
"shell_opposite_normal_dot": normal_dot,
}
@@ -557,7 +558,7 @@ class StepModel(FeatureMixin, ExportMixin, TransformMixin, OperationMixin, Polyd
edit_actions += ";封堵圆柱孔"
elif guess == "round/fillet candidate":
feature_type = "圆角/倒圆候选"
edit_actions = "可尝试修改已有圆角半径;第一版会先移除圆角面,再在恢复出的锐边上重新倒圆。"
edit_actions = "可尝试修改已有圆角半径;当前版本会先移除圆角面,再在恢复出的锐边上重新倒圆。"
elif guess == "boss/outer-round candidate":
feature_type = "凸台/外圆候选"
edit_actions = "调整圆柱凸台直径。"
@@ -668,7 +669,7 @@ class StepModel(FeatureMixin, ExportMixin, TransformMixin, OperationMixin, Polyd
"feature_existing_fillet_support_face_ids": tuple(support_face_ids),
"existing_fillet_note": (
"这是由局部小半径圆柱面推断出的已有圆角/倒圆候选;"
"第一版可尝试使用 defeature + 重新倒圆修改半径;"
"当前版本可尝试使用 defeature + 重新倒圆修改半径;"
"复杂 blend 或支撑面不明确时可能失败并回滚。"
),
}
@@ -1302,6 +1303,12 @@ class StepModel(FeatureMixin, ExportMixin, TransformMixin, OperationMixin, Polyd
info["axis"] = _dir_tuple(circle.Axis().Direction())
info["radius"] = circle.Radius()
info["diameter"] = circle.Radius() * 2.0
if curve_type == GeomAbs_Ellipse:
ellipse = curve.Ellipse()
info["center"] = _point_tuple(ellipse.Location())
info["axis"] = _dir_tuple(ellipse.Axis().Direction())
info["major_radius"] = ellipse.MajorRadius()
info["minor_radius"] = ellipse.MinorRadius()
adjacent_face_ids = self._edge_adjacent_face_ids(edge_id)
info["adjacent_face_ids"] = tuple(adjacent_face_ids)
info["adjacent_face_count"] = len(adjacent_face_ids)