# Calculation of View Factors for Building Simulations with an Open-Source Raytracing Tool
## 2 RADIANCE: Theoretical Basis and General Calculation Methodology
### Specifying Inputs and Interpreting Outputs
The standard approach for creating complex surfaces for RADIANCE simulations is to model the shape initially in a 3D-Modeling software like AutoCAD(r), Sketchup(r), Rhino3D(r) or other similar tools and then export it into a compatible format consisting of polygons. Several free translators and plugins exist for exporting 3D-geometry from CAD software like AutoCAD [30], Sketchup [31] and Rhino3D [32] into RADIANCE format. Figure 8: Surfaces created by using multiple polygons. All the surfaces shown above were first modeled in Sketchup® and then exported into the RADIANCE format using the plugin Su2 Rad. Figure 7: A surface comprised of two polygons and same material. (**a**) Shows the definition of the surface in ASCII format and (**b**) shows a RADIANCE-rendered image of the surface. As explained previously in Figure 3, differential surfaces are defined as per the format \"x y z vx vy vz\". It is possible to specify multiple differential surfaces in a single calculation by listing them in line-separated format. A few examples of multiple differential surfaces are illustrated in Figure 9. Differential surfaces do not have a physical shape or structure in RADIANCE and are intended to specify the location from which rays are to be traced. The cone shapes shown in Figure 9 are intended solely as a means of visualizing their location and orientation. The apex of the cone shapes shown in Figure 9 point in the direction of the vector defined through \"vx vy vz\". As explained in Figure 5, the inputs comprising of finite and differential surfaces need to be sequentially passed to two RADIANCE programs, namely _oconv_ and _rocntrib_, to generate view factors. A typical calculation process, as executed through the command-line, is shown in Figure 10. The figure shows a simple two-step calculation where the view factor \(F_{dA_{1}-A_{2}}\) involving a differential surface \(dA_{1}\) and a finite planar surface \(A_{2}\) is being calculated. The first step involves the creation of the octree from the surface geometry using _oconv_. The second step invokes _rocntrib_ to calculate the \"contribution coefficient\" through Monte Carlo raytracing. The octree \"geo.oct\", generated through _oconv_ in the previous step, is one of the inputs for _rocntrib_. The result from the calculation, a set of three identical numbers, is shown below the _rocntrib_ command in Figure 10. In this example, the contents of the files \"sen.rad\" and \"pts.txt\" represent a finite planar surface and differential surface respectively. The contents of both the files are shown in text boxes. The material for the surface i.e., \"rectangle\", is specified as the \"surfaceIndentifier\" using the -m option for _rocntrib_. The value of ambient bounces (-ab) is not specified as it is set by default to 1 by rcontrib. As described earlier, the numbers relate to the red, green, and blue channels. For the purposes of view factor  
Figure 5:0 An illustration of the command-line process for calculating view factors with RADIANCE. Figure 5:1 Different configurations of differential surfaces that can be specified through a single file, and therefore can be used in a single calculation. The shape in (**a**) illustrates a single differential surface. Shapes in (**b**,**c**) illustrate differential surfaces aligned along a line and distributed across an area respectively. The shape shown in (**d**) illustrates surface normals of planar surfaces that were created by subdividing a spherical surface. calculations with uniformly diffused plastic materials (as explained in Section 2.3), the result for each channel will be identical to the other. As illustrated in the figure, the view factor is obtained by dividing the result from any one of the channels by \(\pi\). The existence of three channels in the calculation is a feature that is inherent to RADIANCE and cannot be disabled. For more complex calculations involving multiple differential surfaces, the results can be redirected to an output file.