|
![](/i/fill.gif) |
Bob Hughes wrote:
> Anyone mind trying to confirm this error?
As Thorstein already has located the error,
I will not comment on that.
I do not know what you are really doing
with your loops.
But if you are doing what I think you are
(placing objects in a 3D grid), then I have
a little suggestion for you below.
If I'm guessing wrong, then please disregard
this post.
Best regards,
Tor Olav
--
mailto:tor### [at] hotmail com
http://www.crosswinds.net/~tok/tokrays.html
#declare AnyThing =
union {
sphere { <0, 0, 0>, 2 }
box { -1.5*<1, 1, 1>, 1.5*<1, 1, 1> }
}
// Nr of objects in each direction
#declare xNr = 21;
#declare yNr = 5;
#declare zNr = 1;
// Adjust to get different grid spacings
#declare vSpacing = <4, 4, 3>;
union {
#declare zCnt = 0;
#while (zCnt < zNr)
#declare yCnt = 0;
#while (yCnt < yNr)
#declare xCnt = 0;
#while (xCnt < xNr)
object {
AnyThing
translate vSpacing*<xCnt, yCnt, zCnt>
}
#declare xCnt = xCnt + 1;
#end // while
#declare yCnt = yCnt + 1;
#end // while
#declare zCnt = zCnt + 1;
#end // while
// Uncomment to translate grid centre to origo
// translate vSpacing*(<1 - xNr, 1 - yNr, 1 - zNr>)/2
pigment { color rgb 1.5*<1, 1, 1> }
}
Post a reply to this message
|
![](/i/fill.gif) |