@lightspeedgraphics/iesna v2.0.3
IESNA
TypeScript library for parsing, inspecting, sampling and rendering the IESNA LM-63 Photometric file format.
This project is heavily based on the original publication "Parsing The IESNA LM-63 Photometric Data
File" and its accompanying source code that is available at
http://lumen.iee.put.poznan.pl/kw/iesna.txt. For reference purposes, a copy of the original
publication is included in this repository under vendor/iesna-c/
.
Usage
To render an IES document to an HTML canvas using this library:
import * as IESNA from "@lightspeedgraphics/iesna";
IESNA.renderToCanvas({
iesData: IESNA.parse("IES document goes here"),
canvas: document.getElementsByTagName("canvas")[0],
});
In addition to the IESNA.renderToCanvas()
method, light sampling can be done using the
IESNA.sample()
function. This function takes an IES data object and an x,y,z coordinate in light
space and returns the light intensity at that position.
const iesData = IESNA.parse("IES document goes here");
const intensity = IESNA.sample({ iesData, x, y, z });
Demo
There is a demo app that shows the rendering of IES documents in the browser. Run it with
npm install && npm run dev
then go to http://127.0.0.1:5000
.
License
Licensed under the MIT license. You must read and agree to its terms to use this software.
Contributors
This library was written by Lightspeed Graphics Ltd. All contributions welcome.