|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
platform: POV35b6 on PII233 128 MB with NT4 SP6
I hope it is not a limitation like #if inside #if
two-line script
#declare A#declare A=0;=1;
#warning str(A,0,0)
prints 1 and I expected it
but script
#declare A=#declare A=0;1;
#warning str(A,0,0)
prints 0 but I expected 1
but what is most strange when I joined both
#declare A#declare A=0;=1;
#warning str(A,0,0)
#declare A=#declare A=0;1;
#warning str(A,0,0)
it twice prints 1
but when I changed it to (replaced second A with B)
#declare A#declare A=0;=1;
#warning str(A,0,0)
#declare B=#declare B=0;1;
#warning str(B,0,0)
it prints 0 and 1
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Skiba <abx### [at] babilonorg> wrote:
> I hope it is not a limitation like #if inside #if
>
> two-line script
> #declare A#declare A=0;=1;
> #warning str(A,0,0)
> prints 1 and I expected it
> but script
> #declare A=#declare A=0;1;
> #warning str(A,0,0)
> prints 0 but I expected 1
> but what is most strange when I joined both
> #declare A#declare A=0;=1;
> #warning str(A,0,0)
> #declare A=#declare A=0;1;
> #warning str(A,0,0)
> it twice prints 1
> but when I changed it to (replaced second A with B)
> #declare A#declare A=0;=1;
> #warning str(A,0,0)
> #declare B=#declare B=0;1;
> #warning str(B,0,0)
> it prints 0 and 1
While I agree that the behavior is confusing, for versions up to and
including 3.5 and any 3.x version or bug fix release that may follow, assume
the behavior of nesting directives inside other directives is not specified.
So the answer is: Don't use it (also the parser allows it) because the
behavior is unlikely to be made consistent before a rewrite of POV-Ray.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 26 Oct 2001 12:20:37 +0200, "Thorsten Froehlich"
<tho### [at] trfde> wrote:
> So the answer is: Don't use it (also the parser allows it) because the
> behavior is unlikely to be made consistent before a rewrite of POV-Ray.
While I can get such answer, shouldn't be such sentence builded into
documentation instead of "directives can appear in almost any place in
the scene file - even in the middle of some other statements". You
wrote "the behavior of nesting directives inside other directives is
not specified". What about #macro inside #macro? #switch inside
#switch? Or mixing: #local inside #macro? This subject should be IMO
described little more within documentation.
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 26 Oct 2001 12:20:37 +0200, "Thorsten Froehlich"
<tho### [at] trfde> wrote:
> So the answer is: Don't use it (also the parser allows it) because the
> behavior is unlikely to be made consistent before a rewrite of POV-Ray.
Is this the same thing ?
#local A=array#local C=1;#while(C<=5)[C]#local C=C+1;#end
personally I prefer post such things to warn people it not work
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Skiba <abx### [at] babilonorg> wrote:
> While I can get such answer, shouldn't be such sentence builded into
> documentation instead of "directives can appear in almost any place in
> the scene file - even in the middle of some other statements". You
> wrote "the behavior of nesting directives inside other directives is
> not specified". What about #macro inside #macro? #switch inside
> #switch? Or mixing: #local inside #macro? This subject should be IMO
> described little more within documentation.
You misunderstood what I mean with nesting. Think about it and it should be
obvious what is meant with nesting based on your examples.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Skiba <abx### [at] babilonorg> wrote:
> Is this the same thing ?
>
> #local A=array#local C=1;#while(C<=5)[C]#local C=C+1;#end
>
> personally I prefer post such things to warn people it not work
I would not recommend the above as it isn't disallowed. Use a macro and
call it, that will always work as you expect.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 26 Oct 2001 15:07:05 +0200, "Thorsten Froehlich"
<tho### [at] trfde> wrote:
> You misunderstood what I mean with nesting.
Perhaps.
> Think about it and it should be
> obvious what is meant with nesting based on your examples.
I just want to say it's good idea to add not working statements to
documentation and write something about this problem.
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 26 Oct 2001 15:09:14 +0200, "Thorsten Froehlich"
<tho### [at] trfde> wrote:
> > Is this the same thing ?
> >
> > #local A=array#local C=1;#while(C<=5)[C]#local C=C+1;#end
> >
> > personally I prefer post such things to warn people it not work
>
> I would not recommend the above as it isn't disallowed. Use a macro and
> call it, that will always work as you expect.
like this ?
#macro B() array#local C=1;#while(C<=5)[C]#local C=C+1;#end #end
#local A=B()
it still not work with beta 6
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
<abx### [at] babilonorg> wrote:
> #macro B() array#local C=1;#while(C<=5)[C]#local C=C+1;#end #end
> #local A=B()
>
> it still not work with beta 6
but this works fine
#local A=array[#local C=1;#while(C<=4)C][#local C=C+1;#end 5]
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
<abx### [at] babilonorg> wrote:
> #macro B() array#local C=1;#while(C<=5)[C]#local C=C+1;#end #end
> #local A=B()
>
> it still not work with beta 6
it is probably connected with next thread
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
|
|
| |
| |
|
|
|
|
| |
|
|