Download node_modules/three/src/lights/RectAreaLight.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 926 Bytes
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/lights/RectAreaLight.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/src/lights/RectAreaLight.js
-
curl -L -o RectAreaLight.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/lights/RectAreaLight.js
926 Bytes
| import { Light } from './Light.js'; | |
| class RectAreaLight extends Light { | |
| constructor( color, intensity, width = 10, height = 10 ) { | |
| super( color, intensity ); | |
| this.isRectAreaLight = true; | |
| this.type = 'RectAreaLight'; | |
| this.width = width; | |
| this.height = height; | |
| } | |
| get power() { | |
| // compute the light's luminous power (in lumens) from its intensity (in nits) | |
| return this.intensity * this.width * this.height * Math.PI; | |
| } | |
| set power( power ) { | |
| // set the light's intensity (in nits) from the desired luminous power (in lumens) | |
| this.intensity = power / ( this.width * this.height * Math.PI ); | |
| } | |
| copy( source ) { | |
| super.copy( source ); | |
| this.width = source.width; | |
| this.height = source.height; | |
| return this; | |
| } | |
| toJSON( meta ) { | |
| const data = super.toJSON( meta ); | |
| data.object.width = this.width; | |
| data.object.height = this.height; | |
| return data; | |
| } | |
| } | |
| export { RectAreaLight }; | |