feat: 完善一级关系编辑 UI 与视图体验

This commit is contained in:
2026-08-06 18:15:14 +08:00
parent 57d75541c3
commit eef9efcc1e
29 changed files with 3907 additions and 178 deletions
+24
View File
@@ -95,6 +95,24 @@ def _axis_affine_point(
)
def _assert_shell_plan_topology(plan: dict[str, object], label: str) -> None:
if plan.get("topology_relation_depth") != 1:
raise SystemExit(f"{label} should expose first-level topology depth: {plan}")
if plan.get("topology_relation_status") != "ready":
raise SystemExit(f"{label} first-level topology should be ready: {plan}")
if int(plan.get("first_level_boundary_edge_count", 0) or 0) < 1:
raise SystemExit(f"{label} should expose boundary Edges: {plan}")
if int(plan.get("first_level_boundary_vertex_count", 0) or 0) < 1:
raise SystemExit(f"{label} should expose boundary Vertices: {plan}")
if int(plan.get("first_level_adjacent_face_count", 0) or 0) < 1:
raise SystemExit(f"{label} should expose direct adjacent Faces: {plan}")
ignored = tuple(plan.get("topology_ignored_relation_depths", ()) or ())
if "second-level" not in ignored or "third-level" not in ignored:
raise SystemExit(f"{label} should document ignored deeper topology: {plan}")
if plan.get("first_level_fact_status") != "ready":
raise SystemExit(f"{label} should expose a ready first-level fact graph: {plan}")
def _assert_logical_face_retained(
model: StepModel,
logical_id: int,
@@ -181,6 +199,7 @@ def _run_case(mode: str, source_thickness: float, target_thickness: float, toler
plan = model.shell_thickness_plan(face_id, target_thickness)
if plan["status"] == "blocked":
raise SystemExit(f"local shell plan was blocked: {plan['message']}")
_assert_shell_plan_topology(plan, "local shell thickness plan")
outward = _vector(plan.get("outward_direction"), "local shell outward_direction")
distance = float(plan.get("push_pull_distance", 0.0))
expected_logical_center = (
@@ -193,6 +212,7 @@ def _run_case(mode: str, source_thickness: float, target_thickness: float, toler
plan = model.shell_thickness_owning_scale_plan(face_id, target_thickness)
if plan["status"] == "blocked":
raise SystemExit(f"owning shell plan was blocked: {plan['message']}")
_assert_shell_plan_topology(plan, "owning shell thickness plan")
expected_logical_center = _axis_affine_point(
before_face_center,
_vector(plan.get("affine_axis_point"), "owning shell affine_axis_point"),
@@ -219,6 +239,10 @@ def _run_case(mode: str, source_thickness: float, target_thickness: float, toler
tolerance,
f"{mode} shell thickness",
)
if "Face result check" not in result:
raise SystemExit(f"{mode} shell thickness result did not report Face result check: {result}")
if "First-level check" not in result:
raise SystemExit(f"{mode} shell thickness result did not report first-level check: {result}")
print(f"mode={mode}")
print(f"face_id={face_id}")