84 lines
2.3 KiB
Python
84 lines
2.3 KiB
Python
"""Command-line entry point installed by ``pyproject.toml``.
|
|
|
|
This mirrors the project-root ``run_underframe_measurement.py`` script so
|
|
that ``pip install`` exposes a console command (``underframe-measure``).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
|
|
from .pipeline import run_measurement_pipeline
|
|
|
|
|
|
def parse_args() -> argparse.Namespace:
|
|
parser = argparse.ArgumentParser(
|
|
description="Measure underframe longitudinal beam deflection from a point cloud.",
|
|
)
|
|
parser.add_argument(
|
|
"--input-cloud",
|
|
required=True,
|
|
help="Path to input scan point cloud (.ply or .xyz).",
|
|
)
|
|
parser.add_argument(
|
|
"--out-dir",
|
|
required=True,
|
|
help="Directory for report.json/.xlsx, CSV files, PLY overlays, and PNG plots.",
|
|
)
|
|
parser.add_argument(
|
|
"--cad",
|
|
default=None,
|
|
help="Optional CAD reference (.ply/.xyz/.stl/.obj) used as the registration baseline.",
|
|
)
|
|
parser.add_argument(
|
|
"--roi",
|
|
default=None,
|
|
help="Optional ROI JSON file holding an axis-aligned bbox in the CAD frame.",
|
|
)
|
|
parser.add_argument(
|
|
"--config",
|
|
default=None,
|
|
help="Optional JSON config override file.",
|
|
)
|
|
parser.add_argument(
|
|
"--profile",
|
|
default="auto",
|
|
choices=["auto", "M", "TC", "TP", "custom"],
|
|
help="Optional profile for scale-related tuning.",
|
|
)
|
|
parser.add_argument(
|
|
"--skip-registration",
|
|
action="store_true",
|
|
help="Bypass ICP even when --cad is supplied (useful for debugging).",
|
|
)
|
|
parser.add_argument(
|
|
"--no-bilateral",
|
|
action="store_true",
|
|
help="Disable the bilateral denoising step.",
|
|
)
|
|
parser.add_argument(
|
|
"--skip-excel",
|
|
action="store_true",
|
|
help="Skip writing the .xlsx error report.",
|
|
)
|
|
return parser.parse_args()
|
|
|
|
|
|
def main() -> None:
|
|
args = parse_args()
|
|
run_measurement_pipeline(
|
|
input_cloud=args.input_cloud,
|
|
out_dir=args.out_dir,
|
|
config_path=args.config,
|
|
profile=args.profile,
|
|
cad_path=args.cad,
|
|
roi_path=args.roi,
|
|
skip_registration=args.skip_registration,
|
|
enable_bilateral=not args.no_bilateral,
|
|
skip_excel=args.skip_excel,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|