|
![](/i/fill.gif) |
McHannemann wrote:
> I have the following problem:
> I have a list of objects which I want to use several times,
> a list with the positions is created and I create the object this way:
>
> #while(counter < Number )
> object{List[position[counter]] transform Transfer[counter]}
> #declare counter = counter + 1;
> #if (mod(counter,10)=0)
> #debug concat(str(counter,0,0),"..")
> #end
> #if (mod(counter,100)=0)
> #debug "n"
> #end
> #end
>
> now to my question,
> this way I create 50000 pieces of one object
> and I get 800MB memory usage,
> with nearly no memory consumption..what do I wrong in this case????
>
The idea of reusing an object with little additional memory cost relates
to objects that themselves have components such as the mesh{} object and
the blob{} object. But the initial declaration of a mesh{}, say, will
require lots of memory if it is comprised of many triangles. However
once declared, it can be instanced multiple times without additionally
multiplying the memory needs.
IE.
#declare M =
mesh {
triangle {...},
triangle {...},
...
triangle {...}
};
LOOP
object { M transform {...} }
END LOOP
BUT
This effect cannot be achieved by unioning a group of objects:
#declare U =
union {
triangle {...},
triangle {...},
...
triangle {...}
};
LOOP
object { U transform {...} }
END LOOP
would multiply the memory cost
Post a reply to this message
|
![](/i/fill.gif) |