import * as THREE from "three"; /** * Build a vertex adjacency graph from a BufferGeometry's index, used for the shortest path in * mode B (geodesic). Vertex coordinates are stored in local space; query points must be converted * to local first (mesh.worldToLocal). * * Note: the geometry must be indexed. modelLoader welds duplicate vertices with mergeVertices so * that vertices at the same surface position are shared, otherwise the adjacency graph won't be connected. * * Performance: O(V²) Dijkstra + O(V) nearest-vertex lookup. Acceptable for a single click on tens * of thousands of vertices; if too large it can later be sped up with a binary heap + spatial grid * (left as a future upgrade). */ export declare class MeshGraph { private positions; private normals; private adj; readonly vertexCount: number; constructor(geometry: THREE.BufferGeometry); private px; private py; private pz; /** Nearest vertex (pass in local coordinates). */ nearestVertex(localPoint: THREE.Vector3): number; /** * Shortest path between two vertices (sequence of vertex indices including endpoints). * Binary-heap Dijkstra, O(E log V). Falls back to [start,end] when disconnected. */ shortestPath(startV: number, endV: number): number[]; vertexWorld(i: number, matrixWorld: THREE.Matrix4): THREE.Vector3; vertexNormalWorld(i: number, mesh: THREE.Mesh): THREE.Vector3; /** Vertex local normal at index i (reads from the welded graphGeo normal attribute). */ vertexNormalLocal(i: number): THREE.Vector3; /** Normal at the vertex nearest to localPoint (for recovering normals from imported point coordinates). */ nearestNormalLocal(p: THREE.Vector3): THREE.Vector3; /** Vertex local coordinates + local normal (the graph geometry is already local space). */ vertexLocal(i: number): { x: number; y: number; z: number; nx: number; ny: number; nz: number; faceIndex: number; }; }