import type { SurfaceOptions } from "../types.ts"; import type { MBox } from "./parts.ts"; import type { Compass } from "./types.ts"; /** Where a figure of the room comes from: a `source` (a rule or a published figure), the `plan` (it follows from the drawn layout) or `ours` (a plausible figure of ours, no source gives it). */ export type RoomBasis = "source" | "plan" | "ours"; /** A wall: its centre line, thickness and height. */ export interface RoomWall { id: string; side: Compass | "octagon"; from: readonly [number, number]; to: readonly [number, number]; thickness: number; height: number | undefined; basis: RoomBasis; } /** A door or a window cut in a wall: the footprint in the wall, the sill (the height of its bottom) and the head (the height of its top). */ export interface RoomOpening { id: string; wall: Compass; box: MBox; sill: number; head: number; } /** A balcony: the strip of floor it covers, its height above the mats, and its rows of seats, from the rail outwards, each higher than the one before. */ export interface RoomBalcony { side: Compass; box: MBox; /** The height of the balcony's front edge above the mats. */ height: number; depth: number; rows: number; rowDepth: number; rowRise: number; /** The height of the rail along the front edge. */ rail: number; /** The seats in each block of a row, from one end of the side to the other: an aisle lies between one block and the next. The same in every row. */ sections: number[]; /** How wide a seat is, in metres: the side's length less its aisles, over its seats (a seat is 0.6 m or a little more). */ seatWidth: number; /** The width of an aisle, in metres (ours). */ aisle: number; /** Where the aisles' middles lie along the side, as shares of its length from 0 to 1. */ aisles: number[]; /** Whether the blocks of seats are the options' (`given`) or cut by us from the side's length. */ sectionsBasis: "given" | "ours"; } /** The room round a budō surface. */ export interface DojoRoom { sport: string; unit: "m"; /** The surface's box: the mats of a competition area, the floor of a dojo, the dohyō's platform, the range of a kyūdōjō. */ floor: MBox; /** The mats: `thickness` is the height of a mat's top above the floor under it, and `edge` how its edge is shaped (a competition mat is covered in vinyl and its edge is rounded), where a competition area's mat stands up at the safety area's outer edge. */ mats: { thickness: number; edge: "rounded" | "square"; basis: RoomBasis; } | undefined; /** The wood round the mats, between them and the walls. */ surround: { outer: MBox; inner: MBox; width: number; material: "wood"; } | undefined; walls: RoomWall[]; /** The raised platforms: a dojo's seat of honour, the sumo dohyō. */ platforms: { id: string; box: MBox; height: number; basis: RoomBasis; }[]; /** The banners: a plain dark vertical banner on a wall (no emblem is drawn), `bottom` and `top` its heights. */ banners: { id: string; wall: Compass; box: MBox; width: number; bottom: number; top: number; basis: RoomBasis; }[]; balconies: RoomBalcony[]; doors: RoomOpening[]; windows: RoomOpening[]; /** The windows high in the wall behind a gallery (a clerestory): the side, the stretch along the wall from its start (metres), the sill and the head, ours. */ upperWindows: { side: Compass; from: number; to: number; sill: number; head: number; }[]; /** How high the room goes above a gallery's floor, for a ceiling over the gallery, and the height of that floor: undefined for a room with no gallery (ours). */ ceiling: { gallery: number; height: number; } | undefined; /** The shrine of a dojo (the shinzen), with its height. */ shrine: { box: MBox; height: number; } | undefined; /** The Budokan's octagon floor: its centre, apothem and corners, going round. */ hall: { id: "budokan"; centre: readonly [number, number]; apothem: number; corners: readonly (readonly [number, number])[]; } | undefined; /** The figures of this room that are ours, and not a source's: the heights of walls and banners, the dais, the balcony. */ notes: string[]; } /** The gallery of a dojo for the crowd: where its first row is from the mats, its depth and the heights of its first and last rows, in metres, from the room's balcony data. */ export interface DojoGallery { offset: number; depth: number; rows: number; /** The seats in each block of a row, and where the aisles lie along a side (shares of its length). */ sections: number[]; aisles: number[]; height: [number, number]; } /** Our heights, in metres, where no source gives one. */ export declare const ROOM_HEIGHTS: Readonly<{ wall: 3; dais: 0.3; bannerBottom: 1; bannerTop: 3; door: 2; windowSill: 1; windowHead: 2.4; shrine: 1.2; rail: 1; balcony: 4.5; ceiling: 4.5; mat: 0.05; rowRise: 0.4; rowDepth: 0.8; balconyDepth: 2.4; balconyRows: 3; aisle: 1.2; seat: 0.6; blockLength: 9.14; }>; /** The blocks of a row along a side `length` metres long: the options' `given`, else as many as a block of about 9 m allows (two at least), each as many seats as fit at 0.6 m with the aisles between. */ export declare function sectionsFor(length: number, given?: readonly number[]): number[]; /** * The room of a budō surface as data: what a 3D view raises. A dojo has its walls (3 m, ours), wood surround, dais, banner, balconies, doors, windows and shrine as its spec asks for them; the other * surfaces have what they have (the mats' thickness, the dohyō's platform at its height, the Budokan's octagon). Heights that no source gives are ours and are listed in `notes`. * @example * ```ts * import { dojoRoom } from "@johnmorrisdotca/kyogijo-stadiums/budo"; * const room = dojoRoom({ sport: "dojo", dojo: { jo: 20, dais: true, banner: true } }); * console.log(room?.walls.length, room?.platforms[0]?.height, room?.banners.length); * // 4 0.3 1 * ``` */ export declare function dojoRoom(o: Pick): DojoRoom | undefined; /** * The gallery a dojo's crowd sits in, from the same balcony data as `dojoRoom()`, so that the 2D stands and a 3D view agree: a thin band of 4 rows (ours) close to the walls, just beyond the wood * surround. A dojo that asks for no balcony still has the default one when it has a crowd; `balcony: false` asks for none, and the sport's own stands are drawn. Not a dojo: nothing. */ export declare function dojoGallery(o: Pick): DojoGallery | undefined;