|
|
I) The code as pasted below bombs out at line 12 with the following:
>> sphere {0,0.5, <----ERROR
>> Parse Error: No matching } in 'sphere', , found instead
II) But if I uncomment out the shwang jibbersih, the error is instead
>> shwang <----ERROR
>> Parse Error: Need at least one component in a blob.
Case II) is expected: it fits in with my understanding of a #macro as
something that just throws text out there.
Case I) is troublesome. It's like the parser says, "If it's jibberish, I'll
treat #macro as a text copy & paste routine; but I'll also take a peek at it
and parse it ****now**** if it looks povvish." )
#declare iter=3;
#declare scal=0.5;
#declare AH=.20;
#declare set=box{-0.5,0.5 rotate <45,0,45> }
#macro set1()
//lala
sphere {0,0.5,1
//shwang {0,0,0}
#end
#macro rec(n)
#if(n>0)
rec(n-1) }
rec(n-1) scale scal translate < AH, AH, AH>}
rec(n-1) scale scal translate < AH, AH,-AH>}
rec(n-1) scale scal translate < AH,-AH, AH>}
rec(n-1) scale scal translate <-AH, AH, AH>}
rec(n-1) scale scal translate < AH,-AH,-AH>}
rec(n-1) scale scal translate <-AH,-AH, AH>}
rec(n-1) scale scal translate <-AH, AH,-AH>}
rec(n-1) scale scal translate <-AH,-AH,-AH>}
#else
set1() }
#end
#end
//blob{ threshold 0.5 rec(iter) pigment{color rgb <0.9,0.1,0.3>}}
Post a reply to this message
|
|
|
|
Your rec() macro never generates an opening "{", so calling "rec(n-1) }" is
meaningless. I'd suggest that you stop confusing yourself and close your
braces in the same macro you open them in.
The reason for the error message in case I) is that the first few lines of
POV that your code generates are:
blob{ threshold 0.5 sphere {0,0.5,1
}
}
sphere {0,0.5, 1
}
[...]
So POV gives the right error message.
Anders
--
light_source{6#local D=#macro B(E)#macro A(D)#declare E=(E-#declare
C=mod(E D);C)/D;C#end#while(E)#if(A(8)=7)#declare D=D+2.8;#else#if(
C>2)}torus{1..2clipped_by{box{-2y}}rotate<1 0C>*90translate<D+1A(2)
*2+1#else}cylinder{0(C-v=1).2translate<D+C*A(2)A(4)#end-2 13>finish
{specular 1}pigment{rgb x}#end#end#end-8;1B(445000298)B(519053970)B
(483402386)B(1445571258)B(77778740)B(541684549)B(42677491)B(70)}
Post a reply to this message
|
|