POV-Ray : Newsgroups : povray.programming : Re: Pains in rendering complex polygons Server Time
5 Jul 2024 16:12:08 EDT (-0400)
  Re: Pains in rendering complex polygons (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: Mike Williams
Subject: Re: Pains in rendering complex polygons
Date: 3 Aug 2003 19:35:28
Message: <M$J$BAA2wZL$EwOy@econym.demon.co.uk>
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

From: Warp
Subject: Re: Pains in rendering complex polygons
Date: 4 Aug 2003 04:48:36
Message: <3f2e1de4@news.povray.org>
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

From: ABX
Subject: Re: Pains in rendering complex polygons
Date: 4 Aug 2003 05:56:53
Message: <04bsivobl3m0omh1leh6mc2i0i2hr9a4dh@4ax.com>
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

From: Christopher James Huff
Subject: Re: Pains in rendering complex polygons
Date: 4 Aug 2003 12:02:51
Message: <cjameshuff-B41606.11011004082003@netplex.aussie.org>
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

From: Warp
Subject: Re: Pains in rendering complex polygons
Date: 4 Aug 2003 15:43:50
Message: <3f2eb776@news.povray.org>
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

From: Christopher James Huff
Subject: Re: Pains in rendering complex polygons
Date: 4 Aug 2003 16:16:13
Message: <cjameshuff-FBC497.15143404082003@netplex.aussie.org>
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

From: ABX
Subject: Re: Pains in rendering complex polygons
Date: 5 Aug 2003 05:27:04
Message: <nrtuivgbvtq63ve53apgfs4abepncm4ggc@4ax.com>
On 4 Aug 2003 15:43:50 -0400, Warp <war### [at] tagpovrayorg> wrote:
>  I was talking about lists of parameters created with #commands (#whiles
>etc).

I recall my discovery from beta testing times when lack of commas still is
parsed fine but behaves wrong:
http://news.povray.org/bp925u4upa1gl9kih2pikg4qusf0lr03kg%404ax.com

ABX


Post a reply to this message

From: Warp
Subject: Re: Pains in rendering complex polygons
Date: 5 Aug 2003 05:30:51
Message: <3f2f794b@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
>>   Anyways, if you want to be sure, you can simply write (-Foo).

> Or you could just use the comma where the syntax specifies one.

  Well, if you think "#if(whatever) , #end" is less obfuscated than "(-Foo)",
then be my guest.

-- 
#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

From: Christopher James Huff
Subject: Re: Pains in rendering complex polygons
Date: 6 Aug 2003 11:38:07
Message: <cjameshuff-81D3A0.10363506082003@netplex.aussie.org>
In article <3f2f794b@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> > Or you could just use the comma where the syntax specifies one.
> 
>   Well, if you think "#if(whatever) , #end" is less obfuscated than "(-Foo)",
> then be my guest.

In some cases, it can be. Usually, I'll use the other method...a single 
entry outside the loop.

Maybe a parameter list structure could eventually be added to the macro 
language...you would just append entries to the list, and ignore the 
comma issue entirely.

#declare ParamList = param_list {< 1, 2, 3>, < 4, 5, 6>}

ParamList.append_value(< 1, 3, 5>);

polygon {ParamList.count
    ParamList
}

Or for the original example:

#declare ParamList = param_list

#declare Blah = 80;
#while(Blah > 0)
    ParamList.append_value(dSpline(Blah));
    #declare Blah = Blah - 1;
#end

polygon {ParamList.count
    ParamList
}

-- 
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

From: Thorsten Froehlich
Subject: Re: Pains in rendering complex polygons
Date: 22 Sep 2003 08:35:50
Message: <3f6eeca6$1@news.povray.org>
In article <3f245b5c@news.povray.org> , Jake McDowell <McN### [at] Techiecom> 
wrote:

> I need to render a fairly complex polygon, somewhat similar to a
> lopsided figure eight or bowtie, in a scene i am working on.

This is the wrong group for this question.  This group is for discussion of
the POV-Ray source code.  General questions about using the POV-Ray scene
description language should be asked in either povray.general or
povray.newusers.

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

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