/** * Straight skeleton of a simple polygon (3..16 vertices, no holes), used to build hip, gable and * pyramid roofs. Felkel/Obdrzalek style event simulation (edge events, split events), with the * simultaneous cases of real footprints (rectangles, squares, plus shapes, regular polygons) * resolved by collapsing zero-width slivers, then planar half-edge traversal for the faces. * * Frame: the public ring is x = east, z = SOUTH, wound counter-clockwise seen from above (negative * shoelace over (x, z)). Internally y = -z, so the ring is an ordinary counter-clockwise polygon. */ export type Vec2 = [number, number]; export interface SkeletonFace { /** Index of the input edge i (the edge from ring[i] to ring[(i+1)%n]) this roof face rises from. */ edge: number; /** * Planar polygon of the face, wound counter-clockwise seen from above, as [x, z, t]: * t = wavefront time = horizontal distance in metres from the footprint edge's line (0 on the edge * itself). Height = slope * t. */ ring: Array<[number, number, number]>; } export interface StraightSkeleton { faces: SkeletonFace[]; /** largest t of any node */ maxT: number; } /** * ring: simple polygon wound counter-clockwise SEEN FROM ABOVE in the plan frame x = east, z = SOUTH. * In (x,z) that is a NEGATIVE shoelace sum. Returns null (never throws) if the polygon is not a clean * simple polygon of 3..16 vertices, has consecutive collinear/duplicate points, or the computation * fails any self-check. */ export declare function straightSkeleton(ring: readonly Vec2[]): StraightSkeleton | null;