File size: 876 Bytes
bdce880
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Normalize an external STL (AhmedML / DrivAerML / NASA-CRM) to the EZFlow
convention: max-extent L=1, centred at origin, and compute the frontal (y-z
projected) reference area for Cd. Reuses the SAME normalizer the training data
used (family_to_stl._normalize_and_measure), so the zero-shot geometries enter
the model on exactly the same scale as training.

Usage:
  python normalize_external.py <stl_in> <name> <out_dir>
Prints one line:  NORM <name> Aref=<aref> -> <out_stl>
"""
import sys, os
sys.path.insert(0, r"C:\dev\EZFlow")
from ezflow_v3.cfd.family_to_stl import _normalize_and_measure

stl_in, name, out_dir = sys.argv[1], sys.argv[2], sys.argv[3]
os.makedirs(out_dir, exist_ok=True)
out_stl = os.path.join(out_dir, f"{name}.stl")
lref, aref = _normalize_and_measure(stl_in, out_stl)
print(f"NORM {name} Lref={lref:.3f} Aref={aref:.6f} -> {out_stl}", flush=True)