import type { TriangleMeshData } from './parse-mesh-ply'; import type { SelectionVolume } from '../../selection/selection-volume'; /** * Splits a collision triangle mesh by the same {@link SelectionVolume} used to * separate a splat region, so the separated object keeps its collision * geometry and both halves stay usable by a host's collision system. * * Collision tiles arrive in the dataset's source-local frame (see * `parse-mesh-ply.ts`), which for `.lcc2` is the frame the mesh matrix maps to * world - the same frame `SplatData.positions` use. So a volume built for the * splats partitions the collision mesh with no extra transform, as long as the * host holds both in that one frame. */ export interface TriangleMeshPartition { /** Triangles assigned to the selection. */ readonly inside: TriangleMeshData; /** Everything else. */ readonly outside: TriangleMeshData; } /** * Partitions a triangle mesh by a selection volume. * * A triangle goes to `inside` when **any** of its vertices is inside the * volume. Triangles are never clipped, so the two halves tile the original * exactly (no cracks, no new geometry); the trade-off is that boundary * triangles overhang the volume by up to one triangle. Vertex winding is * preserved. Vertex buffers are compacted per half - shared vertices are * duplicated into whichever halves reference them. * * @throws {Error} if `mesh` is internally inconsistent (array lengths that * disagree with the declared counts, or an out-of-range index). {@link parseMeshPly} * already guarantees this; a host-built mesh is checked here rather than * silently producing `NaN` positions. */ export declare function partitionTriangleMesh(mesh: TriangleMeshData, volume: SelectionVolume): TriangleMeshPartition;