"""Run design_make_json + design_ik_check for several variants (AFT door, versions A and B) and summarise. python design_variants.py "s,u,px,cle" ... """ import os, sys, json, subprocess HERE = os.path.dirname(os.path.abspath(__file__)); ROOT = os.path.dirname(HERE) BL = r"E:\Steam\steamapps\common\Blender\blender.exe"; PY = r"E:\Tools\Programs\Python\python.exe" CTX = os.path.join(ROOT, "source", "ship_context_2026-10-16.blend") step = os.environ.get("DRA_STEP", "4") for v in sys.argv[1:]: s, u, px, cle = v.split(",") env = dict(os.environ, DRA_S=s, DRA_U=u, DRA_PX=px, DRA_CLE=cle, DRA_OUT=os.path.join(HERE, "var_design.json")) subprocess.run([PY, os.path.join(HERE, "design_make_json.py")], env=env, capture_output=True) for ver in ("A", "B"): out = os.path.join(HERE, "var_check_%s.json" % ver) subprocess.run([BL, "-b", "--factory-startup", CTX, "--python", os.path.join(HERE, "design_ik_check.py"), "--", "AFT", ver, out, step, "0.06"], env=env, capture_output=True) r = json.load(open(out)) j = r["joints"] cl = r["clear_sorted"][:3]; sf = r["self_sorted"][:3] print("%s %s | elb %s q5min %.0f rod %s pist %s rear %.3f | J1 %s J2 %s J3 %s J4 %s J5 %s J6 %s" % (v, ver, r["elbow_inner_deg"], r["min_abs_q5_deg"], r["rod"]["length"], r["rod"]["piston"], r["rod"]["rear_in_lower_max"], j["J1"], j["J2"], j["J3"], j["J4"], j["J5"], j["J6"])) print(" clear:", "; ".join("%s %.3f f%d" % (a, b, c) for a, b, c in cl)) print(" self :", "; ".join("%s %.3f f%d" % (a, b, c) for a, b, c in sf))