Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

ies module

Reads an IESNA LM-63 photometric file and rasterizes its vertical distribution into a layer of the shared feature-texture array.

parse(src) returns the candela values, the vertical angle each was measured at, and the distribution's peak. A file whose header, angle counts or candela block do not agree returns nil and a reason naming which.

toLayer(profile, layer, coneHalfAngleDeg, resolution?) fills a layer with the curve: distance from the image centre is the angle from the cone axis, so the image edge is the cone edge, and the value is the candela at that angle normalized against the peak. Pointing a spot light's cookieLayer at that layer projects the distribution through its cone.

Normalizing against the peak keeps the two concerns apart — the texture carries the distribution's shape, and the light's own brightness carries its exposure. Two fixtures with the same beam shape and different output share a profile.

Only the vertical distribution is used. A cookie is one image projected through the cone, which can express a distribution varying with angle from the axis but not one that also varies with rotation around it; a file whose horizontal planes differ is sampled at its first.