import type { Outline, Pt } from "./crowd.ts"; import { type Plane } from "./turn.kit.ts"; /** How finely the curves of a ring are cut: facets to a quarter of a rounded corner, or round an oval. */ export type Cut = "low" | "auto" | "high"; /** A band of the stands as two polylines of one length, the inner edge and the outer: quad `i` is `inner[i]`, `inner[i + 1]`, `outer[i + 1]`, `outer[i]`. */ export interface Strip { inner: Pt[]; outer: Pt[]; } /** Facets to a quarter circle of a rounded rectangle, and to a whole oval, at each cut. */ export declare const ARC_STEPS: Readonly>; /** The strips of one tier of the stands: its band between `hole` and `region`, with the pieces that are apart from it. */ export declare function stripsOf(region: Outline, hole: Outline | null, more: readonly Outline[], cut: Cut): Strip[]; /** The strip a ring's concourse is: from one outline to another. */ export declare const stripBetween: (inner: Outline, outer: Outline, cut: Cut) => Strip[]; /** A polygon without its repeated neighbours (and its closing point, if given). */ export declare function tidy(points: readonly Pt[]): Pt[]; /** The area of a polygon, signed: positive going clockwise on a page with y down. */ export declare function areaOf(points: readonly Pt[]): number; /** A polygon cut to the inside of a convex polygon (either way round). */ export declare function clipConvex(subject: readonly Pt[], clip: readonly Pt[]): Pt[]; /** A polygon with a box `[x0, y0, x1, y1]` taken out of it: the pieces left (left of it, right of it, and above and below it between), which are convex when the polygon is. */ export declare function clipOutside(poly: readonly Pt[], box: readonly [number, number, number, number]): Pt[][]; /** A polygon with every box taken out of it. */ export declare function clipAround(poly: readonly Pt[], boxes: readonly (readonly [number, number, number, number])[]): Pt[][]; /** A segment cut to the inside of a convex polygon (Cyrus and Beck), or `undefined` when none of it is. */ export declare function clipSegment(a: Pt, b: Pt, clip: readonly Pt[]): [Pt, Pt] | undefined; /** How the height of a raked plane changes with place: `z = z0 + gx (x - x0) + gy (y - y0)`. */ export interface Slope { x0: number; y0: number; z0: number; gx: number; gy: number; } export declare const heightAt: (s: Slope, x: number, y: number) => number; /** The slope of a quad of a band: the height `h0` along its inner edge, `h1` along its outer, rising across it. `undefined` for a quad with no width. */ export declare function slopeOf(q: readonly [Pt, Pt, Pt, Pt], h0: number, h1: number): { slope: Slope; out: Pt; along: Pt; } | undefined; /** * A planar polygon as one plane: its corner and its two sides are in the polygon's own plane, its `u` along the horizontal direction `along` (so that a texture's rows run along a band), its `v` across. * `paint` is given the polygon's corners in the plane's own feet (and a function that puts any plan point there) and answers the SVG drawn on it. */ export declare function raked(id: string, kind: Plane["kind"], poly: readonly Pt[], slope: Slope, along: Pt, paint: (corners: Pt[], local: (p: Pt) => Pt) => string): Plane | undefined; /** Points as the `points` attribute of a polygon. */ export declare const pointList: (pts: readonly Pt[]) => string;