@openpv/simshady
    Preparing search index...

    Class ShadingScene

    This class holds all information about the scene that is simulated. A ShadingScene is typically equipped with the following attributes:

    • Simulation geometry, where the PV potential is calculated
    • Shading geometry, where no PV potential is calculated but which are responsible for shading
    • Solar Irradiance Data that contains information about incoming irradiance in the format of sky domes The Usage of this class and its methods is explained in the "Getting Started" Section of this site.
    Index

    Constructors

    Properties

    elevationRaster: CartesianPoint[]

    A Raster (2D Matrix) holding rasterized data of the terrain, see ShadingScene.addElevationRaster

    shadingGeometry: undefined | BufferGeometry<NormalBufferAttributes>

    A Three.js geometry holding the objects that cause shading, see ShadingScene.addShadingGeometry

    simulationGeometry: undefined | BufferGeometry<NormalBufferAttributes>

    A Three.js geometry holding the main object of the scene, see ShadingScene.addShadingGeometry

    solarIrradiance: null | SolarIrradianceData[]

    A timeseries of Skydomes holding averaged direct and diffuse irradiance data. See ShadingScene.addSolarIrradiance

    Methods

    • Add a elevation model to the simulation scene.

      Parameters

      • raster: CartesianPoint[]

        List of Points with x,y,z coordinates, representing a digital elevation model (DEM). It is important that all values of x,y and z are given with same units. If x and y are given in lat / lon and z is given in meters, this will result in wrong simulation Results.

      • midpoint: CartesianPoint

        The point of the observer, ie the center of the building angle will be [0, ..., 2Pi] where the list has a lenght of azimuthDivisions

      Returns void

    • Adds a geometry as an outer geometry for the shading simulation. These geometries are responsible for shading.

      Parameters

      • geometry: BufferGeometry

        Flat Buffer Array of a Three.js geometry, where three consecutive numbers of the array represent one 3D point and nine consecutive numbers represent one triangle.

      Returns void

    • Adds a geometry as a target for the shading simulation. For these geometries, the PV potential will be simulated. This geometry will also be used as a shading geometry, hence it is not needed to additionally add it by using addShadingGeometry.

      Parameters

      • geometry: BufferGeometry

        Flat Buffer Array of a Three.js geometry, where three consecutive numbers of the array represent one 3D point and nine consecutive numbers represent one triangle.

      Returns void

    • Fetches a SolarIrradiance Object from a url and adds it to the ShadingScene.

      Parameters

      • url: string

      Returns Promise<void>

    • This function is called as a last step, after the scene is fully build. It runs the shading simulation and returns a THREE.js colored mesh. The colors are chosen from the defined colorMap.

      Parameters

      • params: CalculateParams = {}

        The input object containing information about the simulation.

      Returns Promise<
          Mesh<
              BufferGeometry<NormalBufferAttributes>,
              Material | Material[],
              Object3DEventMap,
          >,
      >

      A three.js colored mesh of the simulationGeometry. Each triangle gets an attribute called intensity, that holds the annual electricity in kwh/m2 that a PV system can generate. If ShadingScene.solarIrradiance is a timeseries of sky domes, the resulting intensities attribute is a flattened Float32Array of length T*N.