Model loading · function
readIesProfile
Read an LM-63 photometric file.
Explained in Importing models.
function readIesProfile(text: string): IesProfileimport { readIesProfile } from '@driftengine/assets';Parameters
| Parameter | Type | Description |
|---|---|---|
text | string |
In depth
Whitespace-delimited across line breaks, because that is what the format is. LM-63 attaches
no meaning to a newline inside its numeric lists, and every file a manufacturer publishes wraps
them — so a reader that parses line by line passes a hand-built fixture and fails on everything
real. The header is the only part that is line-oriented, and it ends at TILT=.
Pure, and it takes text rather than a URL, for the reason readRadianceHdr gives: the
fetching decision belongs to the consumer who has to make it, and a pure function is one that can
be tested exactly.
What it costs is holding the whole grid, which for a dense fixture is a few thousand floats.
What would make it wrong is a TILT other than NONE: that describes a fixture mounted at
an angle with its own correction table, and applying the distribution without it would be
confidently wrong rather than obviously wrong — so it is refused by name.