|
![](/i/fill.gif) |
Ken <tyl### [at] pacbell net> wrote:
: Don't
: ask me why this is so but I found after many hair pulling sessions and
: then finaly by asking in these groups how to solve my problem.
Markus explained it well. You can also think about it this way:
#declare i=0;
#while(i<4) // Make 4 copies of this:
merge { sphere { ... } }
#declare i=i+1;
#end
After parsing the result is:
merge { sphere { ... } }
merge { sphere { ... } }
merge { sphere { ... } }
merge { sphere { ... } }
On the other hand:
merge {
#declare i=0;
#while(i<4) // Make 4 copies of this:
sphere { ... }
#declare i=i+1;
#end
}
After parsing the result is:
merge {
sphere { ... }
sphere { ... }
sphere { ... }
sphere { ... }
}
Sometimes the first behaviour is the wanted behaviour. For example:
union {
#declare i=0;
#while(i<4) // Make 4 copies of this:
merge { sphere { ... } sphere { ... } }
#declare i=i+1;
#end
}
The result:
union {
merge { sphere { ... } sphere { ... } }
merge { sphere { ... } sphere { ... } }
merge { sphere { ... } sphere { ... } }
merge { sphere { ... } sphere { ... } }
}
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |