|
 |
Example usage:
#declare Sd = seed(0);
#declare N = 250;
#declare Points = array[N];
#for (I, 0, N-1)
#declare Points[I] = <rand(Sd)*20-10, 0, rand(Sd)*20-10>;
#end
#declare Cells = array[1];
VoronoiCells(Points, Cells)
#for (I, 0, N-1)
#declare NC = dimension_size(Cells[I], 1);
#if (NC > 2)
prism {
0, rand(Sd)*4 + 1,
NC+1,
#for (J, 0, NC-1)
<Cells[I][J].x, Cells[I][J].z>,
#end
<Cells[I][0].x, Cells[I][0].z>
pigment { rgb <rand(Sd)*0.5+0.5, rand(Sd)*0.5+0.5, rand(Sd)*0.5+0.5> }
finish { ambient 0 }
}
#end
#end
Post a reply to this message
|
 |