POV-Ray : Newsgroups : povray.beta-test : Known Bugs Sep 28 Server Time
31 Jul 2024 02:22:27 EDT (-0400)
  Known Bugs Sep 28 (Message 13 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
From:
Subject: Re: Known Bugs Sep 28
Date: 29 Oct 2001 06:01:16
Message: <madqttov353hsu8gaef92809kscol9pre3@4ax.com>
On Mon, 22 Oct 2001 20:05:24 +0200, "Rune" <run### [at] mobilixnetdk> wrote:

> Thank you! It's very appreciated.

this macro is not on the list but I think it could be usefull
(and that's why I talked so much about declaring arrays
and pointing to elements with loops - this macro could
be veeery short with it)

// Array - an array to be resized
// Dimension - number of dimension to be resized
// NewSize - new number of entries for Dimension of Array

#macro Resize_Multi_Array(Array, Dimension, NewSize)
    #if((Dimension>0)&(dimensions(Array)>=Dimension)&(int(Dimension)=Dimension))
        #if(dimensions(Array)!=1)
            #switch(dimensions(Array))
                #case(2)
                    #local NewArray=array
                        [(Dimension!=1?dimension_size(Array,1):NewSize)]
                        [(Dimension!=2?dimension_size(Array,2):NewSize)]
                    #local Max1 =
min(dimension_size(NewArray,1),dimension_size(Array,1));
                #break
                #case(3)
                    #local NewArray=array
                        [(Dimension!=1?dimension_size(Array,1):NewSize)]
                        [(Dimension!=2?dimension_size(Array,2):NewSize)]
                        [(Dimension!=3?dimension_size(Array,3):NewSize)]
                #break
                #case(4)
                    #local NewArray=array
                        [(Dimension!=1?dimension_size(Array,1):NewSize)]
                        [(Dimension!=2?dimension_size(Array,2):NewSize)]
                        [(Dimension!=3?dimension_size(Array,3):NewSize)]
                        [(Dimension!=4?dimension_size(Array,4):NewSize)]
                #break
                #case(5)
                    #local NewArray=array
                        [(Dimension!=1?dimension_size(Array,1):NewSize)]
                        [(Dimension!=2?dimension_size(Array,2):NewSize)]
                        [(Dimension!=3?dimension_size(Array,3):NewSize)]
                        [(Dimension!=4?dimension_size(Array,4):NewSize)]
                        [(Dimension!=5?dimension_size(Array,5):NewSize)]
                #break
                #else
                    #error "Wrong Dimension argument in Resize_Multi_Array macro"
            #end
            #local Max=array[dimensions(Array)]
            #local C=0;
            #while (C<dimensions(Array))
              #local
Max[C]=min(dimension_size(NewArray,C+1),dimension_size(Array,C+1));
              #local C=C+1;
            #end
            #local C=Max
            #switch(dimensions(Array))
                #case(2)
                    #local C[0]=0;
                    #while (C[0]<Max[0])
                        #local C[1]=0;
                        #while(C[1]<Max[1])
                            #ifdef(Array[C[0]][C[1]])
                                #local NewArray[C[0]][C[1]] = Array[C[0]][C[1]];
                            #end
                            #local C[1] = C[1] + 1;
                        #end
                        #local C[0] = C[0] + 1;
                    #end
                #break
                #case(3)
                    #local C[0]=0;
                    #while (C[0]<Max[0])
                        #local C[1]=0;
                        #while(C[1]<Max[1])
                            #local C[2]=0;
                            #while(C[2]<Max[2])
                                #ifdef(Array[C[0]][C[1]][C[2]])
                                    #local NewArray[C[0]][C[1]][C[2]] =
Array[C[0]][C[1]][C[2]];
                                #end
                                #local C[2] = C[2] + 1;
                            #end
                            #local C[1] = C[1] + 1;
                        #end
                        #local C[0] = C[0] + 1;
                    #end
                #break
                #case(4)
                    #local C[0]=0;
                    #while (C[0]<Max[0])
                        #local C[1]=0;
                        #while(C[1]<Max[1])
                            #local C[2]=0;
                            #while(C[2]<Max[2])
                                #local C[3]=0;
                                #while(C[3]<Max[3])
                                    #ifdef(Array[C[0]][C[1]][C[2]][C[3]])
                                        #local NewArray[C[0]][C[1]][C[2]][C[3]] =
Array[C[0]][C[1]][C[2]][C[3]];
                                    #end
                                    #local C[3] = C[3] + 1;
                                #end
                                #local C[2] = C[2] + 1;
                            #end
                            #local C[1] = C[1] + 1;
                        #end
                        #local C[0] = C[0] + 1;
                    #end
                #break
                #case(5)
                    #local C[0]=0;
                    #while (C[0]<Max[0])
                        #local C[1]=0;
                        #while(C[1]<Max[1])
                            #local C[2]=0;
                            #while(C[2]<Max[2])
                                #local C[3]=0;
                                #while(C[3]<Max[3])
                                    #local C[4]=0;
                                    #while(C[4]<Max[4])
                                        #ifdef(Array[C[0]][C[1]][C[2]][C[3]][C[4]])
                                            #local
NewArray[C[0]][C[1]][C[2]][C[3]][C[4]] = Array[C[0]][C[1]][C[2]][C[3]][C[4]];
                                        #end
                                        #local C[4] = C[4] + 1;
                                    #end
                                    #local C[3] = C[3] + 1;
                                #end
                                #local C[2] = C[2] + 1;
                            #end
                            #local C[1] = C[1] + 1;
                        #end
                        #local C[0] = C[0] + 1;
                    #end
                #break
                #else
                    #error "Wrong Dimension argument in Resize_Multi_Array macro"
            #end
            #declare Array = NewArray
        #else
            Resize_Array(Array,NewSize)
        #end
    #else
        #error "Wrong Dimension argument in Resize_Multi_Array macro"
    #end
#end

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From: Rune
Subject: Re: Known Bugs Sep 28
Date: 29 Oct 2001 12:25:15
Message: <3bdd90fb@news.povray.org>

> this macro is not on the list but I think it could be usefull

Hmm, I don't know, so I'd like to hear the opinions of others. Is this macro
useful enough for inclusion?

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Anders K 
Subject: Re: Known Bugs Sep 28
Date: 29 Oct 2001 13:10:45
Message: <3bdd9ba5$1@news.povray.org>
Why don't you allow the array to be one-dimensional? I know that there are
other macros for one-dimensional arrays, but it's trivial to add and it
would make this macro truly general-purpose.


Post a reply to this message

From: Philippe Debar
Subject: Re: Known Bugs Sep 28
Date: 30 Oct 2001 02:55:36
Message: <3BDE5CB2.5000400@yahoo.fr>
Rune wrote:


> 
>>this macro is not on the list but I think it could be usefull
>>
> 
> Hmm, I don't know, so I'd like to hear the opinions of others. Is this macro
> useful enough for inclusion?



Yes imho


Philippe


Post a reply to this message

From:
Subject: Re: Known Bugs Sep 28
Date: 31 Oct 2001 02:49:56
Message: <02bvttc9u5b4slf1arg3c6kbdtga15vvpn@4ax.com>
On Mon, 29 Oct 2001 18:19:33 +0100, "Rune"
<run### [at] mobilixnetdk> wrote:

> "W?odzimierz ABX Skiba" wrote:
> > this macro is not on the list but I think it could be usefull
>
> Hmm, I don't know, so I'd like to hear the opinions of others. Is this macro
> useful enough for inclusion?

I've designed this macro becouse I planned to write Append_To_Array
and Append_Array_To_Array macros working multidimensional.

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From:
Subject: Re: Known Bugs Sep 28
Date: 31 Oct 2001 02:51:07
Message: <v8bvttsq74vv2n9rh68sdfj2nh1d0h48t7@4ax.com>
On Mon, 29 Oct 2001 13:12:59 -0500, "Anders K." <and### [at] f2scom>
wrote:

> Why don't you allow the array to be one-dimensional? I know that there are
> other macros for one-dimensional arrays, but it's trivial to add and it
> would make this macro truly general-purpose.

perhaps you missed this but I don't allow, I just call ready macro to
not duplicate code within one inc file.

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From: Anders K 
Subject: Re: Known Bugs Sep 28
Date: 31 Oct 2001 10:23:07
Message: <3be0175b$1@news.povray.org>
> perhaps you missed this but I don't allow, I just call ready macro to
> not duplicate code within one inc file.

You're right, I did miss this.


Post a reply to this message

From:
Subject: Re: Known Bugs Sep 28
Date: 9 Nov 2001 10:05:35
Message: <s3snut4mqu9u2pp1ndms5i0dstp6gqulfb@4ax.com>
On Mon, 29 Oct 2001 18:19:33 +0100, "Rune" <run### [at] mobilixnetdk> wrote:

> > this macro is not on the list but I think it could be usefull
>
> Hmm, I don't know, so I'd like to hear the opinions of others. Is this macro
> useful enough for inclusion?

I still wait for the answer becouse I don't get strategy for rest of macros.

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From: Rune
Subject: Re: Known Bugs Sep 28
Date: 10 Nov 2001 11:32:28
Message: <3bed569c@news.povray.org>

> I still wait for the answer becouse I don't
> get strategy for rest of macros.

I haven't got many opinions from others but ok, I'll include it.

Can anybody make it more effecient? ~130 lines is quite a lot for such a
macro.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Nov 5)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From:
Subject: Re: Known Bugs Sep 28
Date: 12 Nov 2001 03:07:42
Message: <gk0vutksphcph3ed87fktg0b1r7ciqab19@4ax.com>
On Sat, 10 Nov 2001 17:04:55 +0100, "Rune" <run### [at] mobilixnetdk> wrote:

> Can anybody make it more effecient? ~130 lines is quite a lot for such a
> macro.

It could be much shorten but as I showed in another thread some constructions
not work (http://news.povray.org/0qjittsg3bmv8422pj5egqvo8p4sg9p36h@4ax.com)

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.