|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Greetings people!
I can creat a 100 object matrix by using a while loop as follows:
#declare x1 = 0;
#while (x1 < 10)
#declare z1 = 0;
#while (z1 < 10)
object{Obj translate <x1,0,z1>}
#declare z1 = z1 + 1;
#end
#declare x1 = x1 + 1;
#end
How would I create the same sort of grid where evey other
row in the z direction is offset by 0.5 in the x direction.
My intention is easying the pain of placing shingles on a
roof where it is important that the cracks of overlapping
rows do not line up while back filling the spaces that would
be left by doing so.
Any suggestions ?
Ken Tyler
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 04 Nov 1998 13:49:09 -0800, Ken <tyl### [at] pacbellnet> wrote:
>How would I create the same sort of grid where evey other
>row in the z direction is offset by 0.5 in the x direction.
>My intention is easying the pain of placing shingles on a
>roof where it is important that the cracks of overlapping
>rows do not line up while back filling the spaces that would
>be left by doing so.
//I switched your loops around so you won't have as many calculations.
#declare x2 = 0;
#declare z1 = 0;
#while (z1 < 10)
#declare x1 = 0;
#while (x1 < 10)
object{Obj translate <x1+x2,0,z1>}
#declare x1 = x1 + 1;
#end
#declare x2 = 0.5 - x2;
#declare z1 = z1 + 1;
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I'll try it out. Thank you Ron.
Ken Tyler
Ron Parker wrote:
> //I switched your loops around so you won't have as many calculations.
>
> #declare x2 = 0;
> #declare z1 = 0;
> #while (z1 < 10)
> #declare x1 = 0;
> #while (x1 < 10)
> object{Obj translate <x1+x2,0,z1>}
> #declare x1 = x1 + 1;
> #end
> #declare x2 = 0.5 - x2;
> #declare z1 = z1 + 1;
> #end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
For my next trick....
How would I go about getting each horizontal row to rise
0.2 in the y direction. I attempted the following and ended
up with a slope that should be equivelant to -x -y to +x +y
instead of a uniform -x +x -y to -x +x +y. I hope that made
since.
Perhaps this is a good graphic example of what happened.
/
/
/
/
#declare Obj = box{-1,1 scale<.9,.2,1.5>pigment{rgb 1}}
#declare x2 = 0;
#declare z1 = 0;
#while (z1 < 10)
#declare x1 = 0;
#while (x1 < 10)
object{Obj translate <x1+x2,x1*.2,z1>}
#declare x1 = x1 + 1;
#end
#declare x2 = 0.5 - x2;
#declare z1 = z1 + 1;
#end
Thanks again.
Ken Tyler
Ron Parker wrote:
> On Wed, 04 Nov 1998 13:49:09 -0800, Ken <tyl### [at] pacbellnet> wrote:
> >How would I create the same sort of grid where evey other
> >row in the z direction is offset by 0.5 in the x direction.
> >My intention is easying the pain of placing shingles on a
> >roof where it is important that the cracks of overlapping
> >rows do not line up while back filling the spaces that would
> >be left by doing so.
>
> //I switched your loops around so you won't have as many calculations.
>
> #declare x2 = 0;
> #declare z1 = 0;
> #while (z1 < 10)
> #declare x1 = 0;
> #while (x1 < 10)
> object{Obj translate <x1+x2,0,z1>}
> #declare x1 = x1 + 1;
> #end
> #declare x2 = 0.5 - x2;
> #declare z1 = z1 + 1;
> #end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
x1 goes from 0 to 10 each row, that's why you get this effect when using it for
Y position. Try this:
#declare Obj = box{-1,1 scale<.9,.2,1.5>pigment{rgb 1}}
#declare x2 = 0;
#declare y1 = 0;
#declare z1 = 0;
#while (z1 < 10)
#declare x1 = 0;
#while (x1 < 10)
object{Obj translate <x1+x2,y1,z1>}
#declare x1 = x1 + 1;
#end
#declare x2 = 0.5 - x;
#declare y1 = y1 + .2
#declare z1 = z1 + 1;
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thank you very much.
Ken Tyler
Margus Ramst wrote:
> x1 goes from 0 to 10 each row, that's why you get this effect when using it for
> Y position. Try this:
>
> #declare Obj = box{-1,1 scale<.9,.2,1.5>pigment{rgb 1}}
>
> #declare x2 = 0;
> #declare y1 = 0;
> #declare z1 = 0;
> #while (z1 < 10)
> #declare x1 = 0;
> #while (x1 < 10)
> object{Obj translate <x1+x2,y1,z1>}
> #declare x1 = x1 + 1;
> #end
> #declare x2 = 0.5 - x;
> #declare y1 = y1 + .2
> #declare z1 = z1 + 1;
> #end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |