|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jake McDowell <McN### [at] techiecom> wrote:
> dSpline(blah),
You don't need a comma there.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Warp who wrote:
>Jake McDowell <McN### [at] techiecom> wrote:
>> dSpline(blah),
>
> You don't need a comma there.
Alternatively you could move the comma so that it comes before the
dSpline(blah) and remove the hard-coded one after the 80.
polygon {
80
#declare blah=80;
#while(blah>0)
,dSpline(blah)
#declare blah = blah-1;
#end
}
There are some situations where commas are required and that trick
doesn't work (I can't think of a situation off hand, but I've met one in
the past). In such a case you could process the first or last item
outside the loop
polygon {
80,
dSpline(80) // out of loop, no comma
#declare blah=79;
#while(blah>0)
,dSpline(blah)
#declare blah = blah-1;
#end
}
or put an #if statement round the comma.
polygon {
80,
#declare blah=80;
#while(blah>0)
dSpline(blah)
#if (blah > 1) , #end
#declare blah = blah-1;
#end
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams wrote:
> Wasn't it Warp who wrote:
>
>>Jake McDowell <McN### [at] techiecom> wrote:
>>
>>> dSpline(blah),
>>
>> You don't need a comma there.
>
>
> Alternatively you could move the comma so that it comes before the
> dSpline(blah) and remove the hard-coded one after the 80.
>
> polygon {
> 80
> #declare blah=80;
> #while(blah>0)
> ,dSpline(blah)
> #declare blah = blah-1;
> #end
> }
>
>
> There are some situations where commas are required and that trick
> doesn't work (I can't think of a situation off hand, but I've met one in
> the past). In such a case you could process the first or last item
> outside the loop
>
> polygon {
> 80,
> dSpline(80) // out of loop, no comma
> #declare blah=79;
> #while(blah>0)
> ,dSpline(blah)
> #declare blah = blah-1;
> #end
> }
>
> or put an #if statement round the comma.
>
> polygon {
> 80,
> #declare blah=80;
> #while(blah>0)
> dSpline(blah)
> #if (blah > 1) , #end
> #declare blah = blah-1;
> #end
> }
>
w00t !!! yes ! you rock... can you tell i'm not quite used to the
povray way of doing things ? :]
thank you a load... your information/help here is tremendously valuable
to me... i knew there was a simple way of doing this !
:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]:]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams <mik### [at] econymdemoncouk> wrote:
> Alternatively you could move the comma so that it comes before the
> dSpline(blah) and remove the hard-coded one after the 80.
Why do it the hard way when you can simply omit the comma?
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Warp who wrote:
>Mike Williams <mik### [at] econymdemoncouk> wrote:
>> Alternatively you could move the comma so that it comes before the
>> dSpline(blah) and remove the hard-coded one after the 80.
>
> Why do it the hard way when you can simply omit the comma?
Omitting the comma happens to work for this particular case, but there
are similar situations where commas are required. It might be useful to
be prepared.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams <mik### [at] econymdemoncouk> wrote:
> Omitting the comma happens to work for this particular case, but there
> are similar situations where commas are required.
Can you cite an example?
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 4 Aug 2003 04:48:36 -0400, Warp <war### [at] tagpovrayorg> wrote:
> > Omitting the comma happens to work for this particular case, but there
> > are similar situations where commas are required.
>
> Can you cite an example?
At least commas are necessary in parts of function parser. Below example does
not work without commas.
#local Params=2;
#local F=array[5];
#local F[0]=function(a){0};
#local F[1]=function(a,b){0};
#local F[2]=function(a,b,c){0};
#local F[3]=function(a,b,c,d){0};
#local F[4]=function(a,b,c,d,e){0};
#macro Do(c)
//#if(c>0),#end /* <-- uncomment this line to make it working */
c
#end
#local f=F[Params-1];
#local my_f=function{f(#local C=0;#while(C<Params)Do(C)#local C=C+1;#end)};
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3f2e1de4@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> Mike Williams <mik### [at] econymdemoncouk> wrote:
> > Omitting the comma happens to work for this particular case, but there
> > are similar situations where commas are required.
>
> Can you cite an example?
Anything that has an expression starting with an operator, such as "-x".
polygon {Foo
Foo
-Foo2
Bar
}
The point list will be interpreted as "Foo - Foo2, Bar".
This kind of error can be very difficult to track down. I *always* use
commas, and always use logic which puts them where they are needed.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christopher James Huff <cja### [at] earthlinknet> wrote:
> Anything that has an expression starting with an operator, such as "-x".
> polygon {Foo
> Foo
> -Foo2
> Bar
> }
I was talking about lists of parameters created with #commands (#whiles
etc).
Anyways, if you want to be sure, you can simply write (-Foo).
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3f2eb776@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> I was talking about lists of parameters created with #commands (#whiles
> etc).
And this is still relevant in that case:
#if(Foo)
-Point
#else
Point
#end
> Anyways, if you want to be sure, you can simply write (-Foo).
Or you could just use the comma where the syntax specifies one.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |