The Persistence of Vision Raytracer (POV-Ray).
This is the legacy Bug Tracking System for the POV-Ray project. Bugs listed here are being migrated to our github issue tracker. Please refer to that for new reports or updates to existing ones on this system.
Attached to Project: POV-Ray
Opened by Mike H - 2010-06-09
Last edited by William F Pokorny - 2017-01-20
Opened by Mike H - 2010-06-09
Last edited by William F Pokorny - 2017-01-20
FS#127 - Expandable arrays
Currently, arrays are of a fixed size. You can’t add or remove items to/from an array. I think it would like arrays to be expandable with no fixed and pre-determined size.
Re-allocation on assignment ?
dimension_size() & dimensions() might suggest that the basic support is already there.
Biggest issue might be that multiple dimensions arrays are so far assumed to be regular in size over indexes.
(a 2D is a rectangle, 3D a box, and so on). Most variable size multi-dimension arrays usually consider that they are just holder of N-1 D arrays...
Removing element from array ? how do you make such thing ?
To resume: why not get extension on assignemnt, but as array are not "empty" structure, it might cost a lot for multiple dimensions. (that's only a few millions cycles...)
Removal, I do not understand.
Note that items can be removed from an array by using "#undef Foo[Bar]".
Ah, didn't realize you could undef them.
You still get a warning if you don't set the array size initially.
A little known detail about POV-Ray's arrays is that they can also contain arrays of different elements. That is, you can do things like this:
#declare foo = array[2];
#declare foo[0] = array[2];
#declare foo[1] = array[7];
#declare foo[0][0] = 2;
#declare foo[1][6] = sphere{1,1}
The idea behind this is that an array can only contain elements of the same type, but a two dimensional array is just an array of arrays. And each of these arrays can be of any type. It is quite possible to build complex structures out of this.
As such, it also is not correct that POV-Ray's arrays need to be the same size in every dimension! What follows is that one can actually build trees out of POV-Ray's arrays, among other structures.
Have you seen macro Resize_Array() in arrays.inc?
While Resize_Array() can get the job done, it takes an awful lot of time as the array grows.
Now tracked on github as issue #197.