Difference between revisions of "project07:Expert3"

From 2628Climator
Jump to: navigation, search
(1. The Arrangement of the Cells)
(Programming)
Line 49: Line 49:
 
[[File: Solar_custom.png | 850px]]
 
[[File: Solar_custom.png | 850px]]
  
The image above shows the first attempt of creating a component that could carry out an analysis in the fashion previously described. The y parameter is the radius of the cell, S the centerpoint of the cell from which cast the shadow and D the considered direction of the sunlight as a vector. The VB.net component is a simple gate condition that outputs 1 if x>y, otherwhise it outputs x/y:
+
The image above shows the first attempt of creating a component that could carry out an analysis in the fashion previously described. The y parameter is the radius of the cell, S the centerpoint of the cell from which cast the shadow and D the considered direction of the sunlight as a vector. The VB.net component is a simple gate condition that outputs 1 if 2x>y, otherwhise it outputs 2x/y:
  
  If x > y Then
+
  If 2x > y Then
 
       A = 1
 
       A = 1
 
     Else
 
     Else
Line 57: Line 57:
 
     End If
 
     End If
  
[[File:Scheme voxel light analysis-01-01.png | 200px | left | alt=A]]
+
[[File:Scheme voxel light analysis-01-01.png | 240px | left | alt=A]]
 
This is because, for the sake of this analysis, there is no difference if a given voxel is in not shadowed by a hair's breadth or by far. In this way, a voxel would get a score of 1 (that is fully lit) if the distance of its centerpoint form the axis of a given shadow is larger than the considered voxel radius, otherwise it gets, as score, the ratio between that distance and the radius. To make it clearer, a score of 0.5 indicates that the distance is the half of the radius, therefore the voxel is only lit by half.
 
This is because, for the sake of this analysis, there is no difference if a given voxel is in not shadowed by a hair's breadth or by far. In this way, a voxel would get a score of 1 (that is fully lit) if the distance of its centerpoint form the axis of a given shadow is larger than the considered voxel radius, otherwise it gets, as score, the ratio between that distance and the radius. To make it clearer, a score of 0.5 indicates that the distance is the half of the radius, therefore the voxel is only lit by half.
  

Revision as of 05:59, 13 February 2014



Programming

by Matteo Falduto

1. The Arrangement of the Cells

The building is made of a series of individual, interconnected, cells. An initial issue that had been solved thanks to the power of computing is how to dispose those cells in the space. One among the most important forces that have driven the final shape is the need of providing enough solar illumination to all of them, in order to optimize the growing environment for every species of plants. The approach we have used went through the voxelization of our plot: by subdividing our volume in smaller units, we had the opportunity to test and catalogue an extremely large amount of different possible spatial configurations for our building. We then used the data obtained during this process to construct the optimal shape.

1.1 The voxelization

The voxelization has been accomplished in Grasshopper. The algorithm was fed by a list of generic three dimensional, integer, vectors (representing the generic points of a rectangular grid), a boundary (representing our voronoi cell) and the dimensions of the single voxel. The result was a transformed list of the input vectors obtained by deforming it and culling all duplicate vectors or those that happened to be outside of the voronoi cell. By altering the components of the input list in a range of discrete, integer values, the algorithm is able to produce an unique set of voxels. Those voxels could be interpreted as one of the possible distribution of mass inside the voronoi cell.

In order to optimize the analysis performance and the efficiency of the script, we decided to represent the cells as single voxels.

Voxelization ready.png

1.2 The analysis

The analysis of the set of voxels produced by the previous step has been the most challenging part of the task, both at the conceptual and computational level.

We had to come out with a series of quantitative values that could be used to score a particular configuration of voxels. At that stage we had identified four parameters that had to be kept in consideration during the analysis: the average solar irradiation of the surfaces, the distance between the single cells, the number of neighbouring cells that every cell had and the total population of cells.

1.2.1 The Solar analysis

In order to perform the solar analysis we "materialized" the voxels by assigning to every vector produced at the previous step a box that would roughly approximate each of our cells. At first we considered to use Autodesk Ecotect as the analysis engine, but we soon discovered that any implementation of it would have runned way to slow for our purposes, making unfeasible to test a large enough variety of different configurations. This was partially due to the fact that every configuration had to be exported from grasshopper to the Ecotect software. We therefore looked for a custom integrated script that, while being less accurate, would have delivered a result in a fraction of the time requested by Ecotect. Keeping in mind the peculiarities of the geometry to analyze, which substantially is a grid of identical boxes, we could apply some specific considerations.

An interesting insight came from the algorithms used in computer graphics for displaying lines: those are a family of highly optimized pieces of software that, given a canvas of pixels, and the characteristics of a line to trace (like starting point, direction and length) would determine how to display it on screen, i.e. which pixel would became black and which would stay white. In particular we considered the Xiaolin Wu's line algorithm to generate an antialiased line for the reasons that are about to be explained.

If we were able to implement one of those algorithms for a 3d structure of voxels instead for a 2d array of pixels, we could trace from every cell a line parallel to the sunlight direction to analyze and assume it to be the volumetric shadow of that voxel. Since the line is generated by an aliased line algorithm, it would assign to every voxel a value between 0 and 1, where 1 means completely in shadow and 0 completely unshadowed. Any value in between would represent a voxel only partially casted by the shadow. By multiplying, voxel by voxel, all the values generated by all the other voxels, we would obtain the total volumetric shadow map of the entire configuration. This map could be used to evaluate the solar performance of the given configuration, as, for example, by taking the mean value of this shadowing score for all the cells.

In practice, since an actual 3d implementation of the Xiaolin Wu's algorithms presented some difficulties we decide to trade off some of it's efficiency for the sake of code simplification. We have therefore proceeded implementing the same concept with a geometric approach. By providing one or more significant solar directions to analyze as vectors, we generated form every voxel center point a line with that direction. We then calculated the distance of every other voxel center point of our collection to that line. Those values were compared with a "radius" value that represented the radius of the cell. Every calculated value that was below that radius meant that it's associated voxel would have intersected the shadow casted by the voxel that generated the line. For simplicity we considered significant only the closest three voxels to the line.

Solar custom.png

The image above shows the first attempt of creating a component that could carry out an analysis in the fashion previously described. The y parameter is the radius of the cell, S the centerpoint of the cell from which cast the shadow and D the considered direction of the sunlight as a vector. The VB.net component is a simple gate condition that outputs 1 if 2x>y, otherwhise it outputs 2x/y:

If 2x > y Then
     A = 1
   Else
     A = x / y
   End If
A

This is because, for the sake of this analysis, there is no difference if a given voxel is in not shadowed by a hair's breadth or by far. In this way, a voxel would get a score of 1 (that is fully lit) if the distance of its centerpoint form the axis of a given shadow is larger than the considered voxel radius, otherwise it gets, as score, the ratio between that distance and the radius. To make it clearer, a score of 0.5 indicates that the distance is the half of the radius, therefore the voxel is only lit by half.

1.2.2 The distance score
1.2.3 The neighbouring score
1.2.4 The population score
1.3 The Generative Algorithm