|
|
Both properties and methods. Unions should have an add_object method :)
Now:
union {
#while(I<10)
sphere { x*I, 0.1 }
#declare I=I+1;
#end
}
Or, in loops which have things much more complex than that (for example
if you need to trace() all the created spheres in order to create one more):
#declare Obj = union{};
#while(I<10)
#declare Obj = union { object{Obj} sphere { x*I, 0.1 } };
#declare I=I+1;
#end
(I heard POV-Ray has a special optimization for this, to make the final
in-memory CSG be a flat union like from the first example, instead of a
nested union)
So I'd like:
obj = union{};
while(I<10) {
obj.add(sphere { x*I, 0.1 });
I++;
}
(I'm not suggesting this script syntax, just the concept of adding
objects to already-created CSG structures)
Post a reply to this message
|
|