Install the package using your preferred package manager:
npm install @openpv/simshady
Begin by creating a new ShadingScene
instance:
import ShadingScene from '@openpv/simshady';
const scene = new ShadingScene();
Add one or more simulation geometries—such as buildings or PV panels—using addSimulationGeometry
.
Add shading geometries using addShadingGeometry
:
scene.addShadingGeometry(someShadingGeometry);
scene.addSimulationGeometry(someSimulationGeometry);
Include irradiance data in the required format via addSolarIrradiance
. This data should contain time series for both direct and diffuse irradiance:
scene.addSolarIrradiance(someSolarIrradianceData);
Call the calculate
method to perform the simulation. It returns a Three.js Mesh, which can be used directly in a Three.js scene:
let mesh = await scene.calculate({
solarToElectricityConversionEfficiency: 0.15,
});
showThreeJS(mesh);
💡 You can see a real-world usage example at openpv.de.