Files
pythonocc-step-editor/scripts/verify_edge_edit_suite.py

102 lines
3.3 KiB
Python

from __future__ import annotations
import subprocess
import sys
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parent.parent
SCRIPT_DIR = PROJECT_ROOT / "scripts"
CASES: tuple[tuple[str, tuple[str, ...]], ...] = (
(
"Edge first-level topology and edit-plan facts",
("verify_edge_first_level_topology.py",),
),
(
"Edge length auto strategy resolves to local deformation",
(
"verify_edge_length_resize.py",
"--strategy",
"auto",
"--anchor",
"keep-start",
"--expect-strategy",
"local-edge-only-deform",
),
),
(
"Edge length local deformation, fixed start point",
("verify_edge_length_resize.py", "--strategy", "local-edge-only-deform", "--anchor", "keep-start"),
),
(
"Edge length local deformation, fixed end point",
("verify_edge_length_resize.py", "--strategy", "local-edge-only-deform", "--anchor", "keep-end"),
),
(
"Edge length local deformation, fixed center",
("verify_edge_length_resize.py", "--strategy", "local-edge-only-deform", "--anchor", "center"),
),
(
"Edge length move end plane, fixed start point",
("verify_edge_length_resize.py", "--strategy", "move-edge-end-plane-by-push-pull", "--anchor", "keep-start"),
),
(
"Edge length keep first-level planar relations, fixed start point",
("verify_edge_length_resize.py", "--strategy", "keep-first-level-planar-relations", "--anchor", "keep-start"),
),
(
"Edge length move end plane, fixed end point",
("verify_edge_length_resize.py", "--strategy", "move-edge-end-plane-by-push-pull", "--anchor", "keep-end"),
),
(
"Edge length scale owning object, fixed start point",
("verify_edge_length_resize.py", "--strategy", "scale-owning-shape-from-edge", "--anchor", "keep-start"),
),
(
"Edge length scale owning object, fixed end point",
("verify_edge_length_resize.py", "--strategy", "scale-owning-shape-from-edge", "--anchor", "keep-end"),
),
(
"Edge length scale owning object, fixed center",
("verify_edge_length_resize.py", "--strategy", "scale-owning-shape-from-edge", "--anchor", "center"),
),
(
"Edge start, center and end coordinate edits",
("verify_edge_coordinate_edit.py",),
),
(
"Edge invalid, no-op and oversized target guards",
("verify_edge_target_guards.py",),
),
(
"Edge modeling-intent scopes and plan mapping",
("verify_edge_intent_specs.py",),
),
(
"Edge fillet, chamfer, asymmetric chamfer, distance-angle chamfer and existing fillet resize",
("verify_edge_round_chamfer.py",),
),
(
"Ellipse Edge major and minor radius resize",
("verify_ellipse_edge_resize.py",),
),
)
def main() -> int:
for index, (label, command) in enumerate(CASES, start=1):
print(f"\n[{index}/{len(CASES)}] {label}", flush=True)
subprocess.run(
(sys.executable, str(SCRIPT_DIR / command[0]), *command[1:]),
cwd=PROJECT_ROOT,
check=True,
)
print("\nEdge edit suite passed.", flush=True)
return 0
if __name__ == "__main__":
raise SystemExit(main())