2.0.3 • Published 2 years ago

@lightspeedgraphics/iesna v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

IESNA

npm version ci semantic-release

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.

2.0.3

2 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago