#!/usr/bin/env python3 """Lock the two decisions that are easy to get silently wrong in build_vehicle: 1. which parts rotate with the gimbal yaw (`classify`) 2. where the yaw axis actually is (`find_yaw_axis`) Both used to be wrong: the motor centre was taken as the yaw axis even though a belt drives it (89.9 mm offset), and the broad `基座装配` keyword pulled the motor and base plates into the rotating mesh. """ import os from pathlib import Path import struct import sys import tempfile import unittest TOOLS = Path(__file__).resolve().parents[1] sys.path.insert(0, str(TOOLS)) import build_vehicle PREFIX = '完全车2 - 装配体-3 ' def write_box_stl(path, lo, hi): """Write a one-triangle binary STL whose bounding box is exactly [lo, hi].""" vertices = [(lo[0], lo[1], lo[2]), (hi[0], lo[1], lo[2]), (lo[0], hi[1], hi[2])] path.parent.mkdir(parents=True, exist_ok=True) with open(path, 'wb') as handle: handle.write(b'\0' * 80) handle.write(struct.pack('