import type { SpinResult, Verdict, Vec3, WheelRow } from './vehicleMath'; /** Stance tolerances. The published Porsche reads 0.4802 drawn / 0.4800 physics for a declared 0.48. */ export declare const STANCE_THRESHOLDS: { /** Measured body-origin height vs the declared groundToBodyOrigin. Beyond this the car rides visibly high or low. */ readonly groundToBodyOriginTolM: 0.02; /** groundToBodyOrigin vs wheelRadius + staticRideHeight (the package's own arithmetic). */ readonly declaredSumTolM: 0.005; /** Mean measured rolling radius vs the declared wheel radius, as a fraction of it. The drive is a ~1 s coast, so one wheel is noisy. */ readonly rollingRadiusTolFraction: 0.06; /** Any single wheel's rolling radius vs declared (driven wheels slip under power: the published Porsche's rear reads -8 %). */ readonly rollingRadiusWheelTolFraction: 0.15; }; export interface DeclaredStance { groundToBodyOriginM: number | null; wheelRadiusM: number | null; staticRideHeightM: number | null; /** wheelRadius + staticRideHeight, when both are declared. */ impliedGroundToBodyOriginM: number | null; } /** A package number is either a bare number or a `{ value, unit, sources }` record. */ export declare function numberOf(v: unknown): number | null; export declare function declaredStance(pkg: Record | null | undefined): DeclaredStance; export interface StanceWheel { id: string; /** Body origin's height above this wheel's drawn tyre bottom (drawn centre y - drawn radius, body frame). */ drawnGroundBelowOriginM: number | null; /** Body origin's height above this wheel's physics ground (hub y - physics radius, body frame). */ physicsGroundBelowOriginM: number; /** Lowest body point above this wheel's own contact level, within +-0.6 m longitudinally. */ bodyClearanceM: number | null; drawnRadiusM: number | null; physicsRadiusM: number; /** Drawn centre minus physics hub, body frame (x/y/z). */ hubDeltaM: Vec3 | null; } export interface MeasuredStance { /** Mean over the wheels. Null when nothing could be measured. */ drawnGroundToBodyOriginM: number | null; physicsGroundToBodyOriginM: number | null; /** Ground plane tilt in the body frame (pitch about x / roll about z), degrees, from the drawn contact plane. */ pitchDeg: number | null; rollDeg: number | null; /** Lowest drawn body point above the contact plane (the car's ground clearance). */ lowestBodyPointM: number | null; lowestBodyMesh: string | null; wheels: StanceWheel[]; } /** `physicsSettled` false (the car never reached all wheels grounded) withholds the physics numbers: a hub read from an * unsettled suspension is the rest length, not the stance. */ export declare function measureStance(rows: WheelRow[], plane: [number, number, number], ride: { minM: number | null; mesh: string | null; }, opts?: { physicsSettled?: boolean; }): MeasuredStance; /** The headline: is the car sitting where the package says it does? Blocks when the declared stance cannot be trusted. */ export declare function judgeStance(declared: DeclaredStance, m: MeasuredStance, t?: { /** Measured body-origin height vs the declared groundToBodyOrigin. Beyond this the car rides visibly high or low. */ readonly groundToBodyOriginTolM: 0.02; /** groundToBodyOrigin vs wheelRadius + staticRideHeight (the package's own arithmetic). */ readonly declaredSumTolM: 0.005; /** Mean measured rolling radius vs the declared wheel radius, as a fraction of it. The drive is a ~1 s coast, so one wheel is noisy. */ readonly rollingRadiusTolFraction: 0.06; /** Any single wheel's rolling radius vs declared (driven wheels slip under power: the published Porsche's rear reads -8 %). */ readonly rollingRadiusWheelTolFraction: 0.15; }): Verdict; /** The package's own arithmetic: groundToBodyOrigin should equal wheelRadius + staticRideHeight (the spawn pose is the rest pose). */ export declare function judgeDeclaredSum(d: DeclaredStance, t?: { /** Measured body-origin height vs the declared groundToBodyOrigin. Beyond this the car rides visibly high or low. */ readonly groundToBodyOriginTolM: 0.02; /** groundToBodyOrigin vs wheelRadius + staticRideHeight (the package's own arithmetic). */ readonly declaredSumTolM: 0.005; /** Mean measured rolling radius vs the declared wheel radius, as a fraction of it. The drive is a ~1 s coast, so one wheel is noisy. */ readonly rollingRadiusTolFraction: 0.06; /** Any single wheel's rolling radius vs declared (driven wheels slip under power: the published Porsche's rear reads -8 %). */ readonly rollingRadiusWheelTolFraction: 0.15; }): Verdict; export interface RollingRadius { id: string; /** distance / drawn rotation. Null when the wheel did not turn. */ rollingRadiusM: number | null; declaredRadiusM: number; /** (rolling - declared) / declared. */ errorFraction: number | null; } /** Effective rolling radius of each drawn wheel from the drive: distance rolled over the angle the drawn wheel turned. */ export declare function rollingRadii(spin: Pick, declaredRadiusM: number[]): RollingRadius[]; export declare function judgeRollingRadius(rows: RollingRadius[], declaredWheelRadiusM: number | null, t?: { /** Measured body-origin height vs the declared groundToBodyOrigin. Beyond this the car rides visibly high or low. */ readonly groundToBodyOriginTolM: 0.02; /** groundToBodyOrigin vs wheelRadius + staticRideHeight (the package's own arithmetic). */ readonly declaredSumTolM: 0.005; /** Mean measured rolling radius vs the declared wheel radius, as a fraction of it. The drive is a ~1 s coast, so one wheel is noisy. */ readonly rollingRadiusTolFraction: 0.06; /** Any single wheel's rolling radius vs declared (driven wheels slip under power: the published Porsche's rear reads -8 %). */ readonly rollingRadiusWheelTolFraction: 0.15; }): Verdict; export interface StrayWheelMesh { mesh: string; centre: Vec3 | null; } /** * The engine adopts a wheel mesh only when its pivot sits at the physics hub; a wheel authored off its hub (a model raised * or lowered against the declared stance, a wrong track or wheelbase) is left behind as a loose mesh and the car runs on * no drawn wheels at all. When that happens, name each loose wheel and how far it is from its nearest hub, so the author * sees which way and by how much the model disagrees with the package. */ export declare function judgeWheelBinding(rows: WheelRow[], strays: StrayWheelMesh[]): Verdict;