Skip to content
Shapemetry

Types - Light

API reference for ./geometry/light on @huukhanhnguyen/types.

See the Guide for the package's role.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

Light

type

One emitting object's geometry: where it is, what shape emits, and what it radiates.

Photometric units, so an author states what a manufacturer prints on the box and a renderer converts to its own.

type Light
// = LightShape & { /** Emitter centre in model space (mm). */ position: Point; /** Unit axis the emitter faces. A `disk`/`rectangle` needs one (a flat * emitter has a front); a `point`/`sphere` radiates in every direction and * carries none unless a cone narrows it; a `cylinder` uses it as its own * axis. */ direction?: Vector; /** Luminous flux of the whole emitter, in lumens. A 60 W-equivalent * household bulb is ≈ 800 lm; a 600×600 office panel ≈ 4000 lm. */ lumens: number; /** Colour temperature in kelvin — 2700-3000 warm, 4000 neutral, 5500-6500 * daylight. Absent = the renderer's neutral white. */ kelvin?: number; /** Hex colour override (`"#ffd6aa"`). When set, `kelvin` is ignored. */ color?: string; /** FULL cone angle in degrees about `direction` — what a renderer calls a * spot. Absent = the emitter radiates over everything its shape can see: * a point in every direction, a flat emitter over its hemisphere. */ coneAngle?: number; /** Soft-edge fraction of that cone, 0 (hard cut) … 1 (fully soft). Only * meaningful with `coneAngle`. */ penumbra?: number; /** Name of an IES photometric file — the manufacturer's measured * distribution, which supersedes `coneAngle`/`penumbra` when a consumer * can read it. A `url`-method parameter key or a direct URI, the same * by-name law every other asset reference uses. */ ies?: string; }

LightShape

type

The emitting shape. A tagged union because these are genuinely different geometry — a disk has a radius and a rectangle has two sides — not because a renderer happens to have a class per kind.

point carries no extent at all: the idealisation, and the right answer for a filament small against the room.

type LightShape
// = {
    shape: "point";
}
Last updated: 📖 1 min readEdit on GitHub