import type { VisualQaAssert } from './types'; export type Vec3 = [number, number, number]; export interface Box { min: Vec3; max: Vec3; size?: Vec3; } /** A wheel instance must be centred this close to a distinct hub. */ export declare const HUB_TOLERANCE_M = 0.04; /** Two instance centres closer than this are the SAME drawn place (stacked replicas). */ export declare const DISTINCT_INSTANCE_M = 0.04; /** A non-wheel part whose drawn centre is this close to the host origin is "at the origin". */ export declare const ORIGIN_TOLERANCE_M = 0.1; /** Host wheels drawn vs the package's physics: wheelbase / track / hub height must agree within this. */ export declare const PHYSICS_CROSSCHECK_M = 0.05; /** Share of a worn item's drawn vertices that must fall inside its slot's body region. */ export declare const REGION_OVERLAP_MIN = 0.6; /** Outfits must also span this share of the neck-to-ankle height. Calibrated 2026-10-02 from the sweep: legitimate * mini dresses and a leotard span 0.44-0.53 of neck-to-ankle, full outfits 0.8-1.3, and the 26 cm Male Police * Uniform lump 0.12. 0.6 failed every dress under ~1 m; 0.30 keeps the lump (and a torso-only lump) failing. */ export declare const OUTFIT_COVERAGE_MIN = 0.3; /** Max gap between a worn item and the body surface (sampled body vertices), metres. */ export declare const NOT_FLOATING_MAX_M = 0.04; export declare const centreOf: (b: Box) => Vec3; export declare const dist: (a: Vec3, b: Vec3) => number; export declare const unionBox: (boxes: Array) => Box | null; /** Cluster points: returns one representative per group of points within `eps` of each other (single linkage). */ export declare function distinctPoints(points: Vec3[], eps?: number): Vec3[][]; export interface DrawnWheel { corner: string; nodes: string[]; bounds: Box | null; } export interface Hub { socket: string; centre: Vec3; source: 'drawn' | 'physics'; } export interface ChassisPhysics { wheelbase: number | null; trackFront: number | null; trackRear: number | null; wheelRadius: number | null; groundToBodyOrigin: number | null; } /** Chassis numbers from a vehicle package root (`physics.chassis.*`, either bare numbers or `{value}` records). */ export declare function chassisPhysics(pkg: Record | null): ChassisPhysics; /** * Hubs from the host's OWN drawn wheel geometry (rim/tyre bounds centres, measured before anything is fitted), * cross-checked against the package physics: wheelbase (front↔rear on each side), track (left↔right on each * axle) and hub height above the drawn ground (= wheelRadius). When the host draws no wheel geometry the hubs are * derived from physics alone, laid out about the host's drawn footprint, and the result says so. */ export declare function deriveHubs(drawn: DrawnWheel[], physics: ChassisPhysics, host: { bounds: Box | null; forward: Vec3; groundY: number | null; }): { hubs: Hub[]; source: 'drawn' | 'physics' | 'none'; crossCheck: Record; crossCheckOk: boolean | null; }; export interface PartInstance { key: string; socket: string | null; attachedTo: string | null; meshes: number; bounds: Box | null; } /** `addon.at_socket` for a wheel set: N distinct drawn instances, each within HUB_TOLERANCE_M of a distinct hub. */ export declare function wheelAtSocketAssert(subject: string, instances: PartInstance[], hubs: Hub[], declared: { count: number; sockets: string[]; }, hostOrigin: Vec3): VisualQaAssert; /** Where on a vehicle a slot type's part belongs. `null` = anywhere on/in the host (engine, turbo, sway bars …). */ export declare function vehicleRegionFor(slotType: string): { along: 'rear' | 'front' | null; height: 'upper' | 'lower' | null; why: string; }; /** `addon.at_socket` for a non-wheel vehicle part: inside the host, in its slot's region, not at the host origin. */ export declare function vehiclePartAtSocketAssert(subject: string, part: Box | null, host: Box | null, ctx: { slotType: string; forward: Vec3; hostOrigin: Vec3; socket?: { name: string; at: Vec3; } | null; }): VisualQaAssert; export type Bones = Record; declare const BONE_PATTERNS: Record; export declare function findBone(bones: Bones, key: keyof typeof BONE_PATTERNS | string): Vec3 | null; /** Body region a slot's item must overlap, as a world AABB built from the base's bones and its drawn body bounds. */ export declare function bodyRegion(slot: string, bones: Bones, body: Box): { region: string; box: Box; socketBone: string | null; } | null; /** Share of points inside a box. */ export declare function overlapShare(flat: number[], box: Box): number; /** Smallest distance from any item point to any body point (brute force on a uniform grid hash). */ export declare function minDistance(itemFlat: number[], bodyFlat: number[]): { min: number; p50: number; }; /** `wear.on_body_bounds`: the item's drawn vertices overlap the slot's body region (and outfits span the body). */ export declare function onBodyAssert(subject: string, slot: string, itemFlat: number[], bones: Bones, body: Box | null): VisualQaAssert; /** `wear.not_floating`: closest approach of the item to the base's body surface (sampled body vertices). */ export declare function notFloatingAssert(subject: string, itemFlat: number[], bodyFlat: number[]): VisualQaAssert; /** `addon.at_socket` for a character add-on: drawn centre inside the socket bone's region, near the bone, not at the base origin. */ export declare function characterAtSocketAssert(subject: string, slot: string, part: Box | null, bones: Bones, body: Box | null, baseOrigin: Vec3, instances: number): VisualQaAssert; /** View directions (unit vectors, target → camera) from a forward axis; Y is up. */ export declare function viewDirs(forward: Vec3): Record<'front' | 'back' | 'side' | 'q3front' | 'q3rear' | 'top', Vec3>; export {};