Skip to content

TypeScript library for parsing and rendering the IESNA LM-63 Photometric file format.

License

Notifications You must be signed in to change notification settings

richard-viney/iesna

Repository files navigation

IESNA

TypeScript library for parsing and rendering the
IESNA LM-63 Photometric file format

About

This project is heavily based on the original publication "Parsing The IESNA LM-63 Photometric Data File" and its accompanying source code, which can be found here.

Usage

To render an IES document to an HTML canvas using this library:

import * as IESNA from "iesna";

IESNA.renderToCanvas({
  iesData: IESNA.parse("IES document goes here"),
  canvas: document.getElementsByTagName("canvas")[0],
});

In addition to IESNA.renderToCanvas(), light sampling can be done using IESNA.sample(). 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 of rendering IES documents in the browser available here.

To run it locally: npm install && npm run dev.

About

TypeScript library for parsing and rendering the IESNA LM-63 Photometric file format.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published