POV-Ray : Newsgroups : povray.general : Spline problem Server Time
7 Aug 2024 01:23:41 EDT (-0400)
  Spline problem (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Christopher James Huff
Subject: Re: Spline problem
Date: 19 Jan 2002 16:29:31
Message: <chrishuff-1EEB89.16302619012002@netplex.aussie.org>
In article <3c49df0d@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   I'll let it as an exercise how complicated that would need to be done if
> commas were mandatory.

Not very. I always do it anyway, for possible forwards compatability in 
case a future version makes them required.

spline {cubic_spline
    #declare Ind = 0;
    #while(Ind < 9)
        Ind, <Ind, Ind*Ind, 0>
        #declare Ind = Ind + 1;
    #end
    Ind, <Ind, Ind*Ind, 0>
}

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

From: Jan Walzer
Subject: Re: Spline problem
Date: 19 Jan 2002 16:29:55
Message: <3c49e553$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg>  wrote:
>   Now suppose that the commas were mandatory. That wouldn't work anymore.
> It won't work either if you add a comma after the vector.
>   I'll let it as an exercise how complicated that would need to be done if
> commas were mandatory.

Only one line more, if the following parses ...

spline
{ cubic_spline
  0, 0
  #declare Ind = 1;
  #while(Ind < 10)
    ,Ind, <Ind, Ind*Ind, 0>
    #declare Ind = Ind+1;
  #end
}


OK .. I(We all) know, what you mean, but probably this example was too simple
...

Question: How far back do we need Backward-compatibility ?
Commas are standard at least since 3.0, so I think somewhere should be a
hard-cut ...

_IF_ all the suggestions for the (somewhere in the far future) POV4 will
come true, we
will have a complete(?) different SDL, with hardly any way for
backward-compatibility ...


--
[Talking about cardriving]
"People are opstacles?
Oh...I always treat them as bonus points..." [Ian Burgmyer in p.o-t]
// Jan Walzer <jan### [at] lzernet>


Post a reply to this message

From: Warp
Subject: Re: Spline problem
Date: 19 Jan 2002 16:59:53
Message: <3c49ec58@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
: Not very. I always do it anyway, for possible forwards compatability in 
: case a future version makes them required.

  If a future version makes commas mandatory, that would be a huge step
*backwards* in versatility.
  (Unless a #-command can replace a 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

From: Christopher James Huff
Subject: Re: Spline problem
Date: 19 Jan 2002 17:44:12
Message: <chrishuff-4B8A52.17450919012002@netplex.aussie.org>
In article <3c49ec58@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   If a future version makes commas mandatory, that would be a huge step
> *backwards* in versatility.

How?

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

From: Warp
Subject: Re: Spline problem
Date: 19 Jan 2002 18:49:12
Message: <3c4a05f7@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
:>   If a future version makes commas mandatory, that would be a huge step
:> *backwards* in versatility.

: How?

  Because it would disallow making automatic generation of long lists of
items (number, vectors...) in such a simple and versatile way as currently.
  Currently it's just enough to create the list of items in a loop, without
having to take into account that there should be one comma less than the
number of items.
  (Note that the problem with the solution you suggested is that there might
be cases where the loop is not executed even once, that is, no items are
created at all.)

-- 
#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: Spline problem
Date: 19 Jan 2002 19:19:30
Message: <chrishuff-240E57.19202719012002@netplex.aussie.org>
In article <3c4a05f7@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Because it would disallow making automatic generation of long lists of
> items (number, vectors...) in such a simple and versatile way as currently.
>   Currently it's just enough to create the list of items in a loop, without
> having to take into account that there should be one comma less than the
> number of items.
>   (Note that the problem with the solution you suggested is that there might
> be cases where the loop is not executed even once, that is, no items are
> created at all.)

In this case it's an extra line and some math in the loop. The cases you 
mention aren't that common, and you can still put a comma on every line 
but the last, it's just a little more complex. Not by very much, 
either...just by one #if() statement in the mix.

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

From: Peter J  Holzer
Subject: Re: Spline problem
Date: 20 Jan 2002 14:01:18
Message: <slrna4m15e.694.hjp-usenet@teal.h.hjp.at>
On 2002-01-20 00:20, Christopher James Huff <chr### [at] maccom> wrote:
> In article <3c4a05f7@news.povray.org>, Warp <war### [at] tagpovrayorg> 
> wrote:
> 
>>   Because it would disallow making automatic generation of long lists of
>> items (number, vectors...) in such a simple and versatile way as currently.
>>   Currently it's just enough to create the list of items in a loop, without
>> having to take into account that there should be one comma less than the
>> number of items.
>>   (Note that the problem with the solution you suggested is that there might
>> be cases where the loop is not executed even once, that is, no items are
>> created at all.)
> 
> In this case it's an extra line and some math in the loop. The cases you 
> mention aren't that common, and you can still put a comma on every line 
> but the last, it's just a little more complex.

You could also allow a superfluous comma after the last item, like many
other programming languages (e.g., C and perl) do.

	hp

-- 

|_|_) | Sysadmin WSR       | Verstand, die Augen haben und nicht sehen,

__/   | http://www.hjp.at/ |    -- Jeremia 5:21


Post a reply to this message

From:
Subject: Re: Spline problem
Date: 21 Jan 2002 03:07:14
Message: <0tin4usrh1hbhf2td9the8l6l19rctr2e0@4ax.com>
On Sat, 19 Jan 2002 19:20:27 -0500, Christopher James Huff <chr### [at] maccom>
wrote:
> just by one #if() statement in the mix.

parsing is slowest part of  POV, such additional #if() could slow down simple
loops  more then twice sometimes imo

ABX


Post a reply to this message

From: Ron Parker
Subject: Re: Spline problem
Date: 21 Jan 2002 07:42:44
Message: <slrna4o366.f44.ron.parker@fwi.com>
On Sat, 19 Jan 2002 22:30:07 +0100, Jan Walzer wrote:
> Question: How far back do we need Backward-compatibility ?
> Commas are standard at least since 3.0, so I think somewhere should be a
> hard-cut ...

But why?  The cases where it's still possible to leave them out are perfectly
unambiguous anyway, so why require them?

-- 
#macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C,T)bicubic_patch{type 1u_steps
6v_steps 6R(1)R(3)R(5)R(7)pigment{rgb z}}#end#macro _(Y)#local X=asc(substr(C,Y
,1))-65;<T+mod(X,4)div(X,4)9>-2#end#macro O(T)Q("ABEFUQWS",T)Q("WSXTLOJN",T)#
end O(0)O(3)Q("JNKLCGCD",0)light_source{x 1}// ron### [at] povrayorg


Post a reply to this message

From: Christopher James Huff
Subject: Re: Spline problem
Date: 21 Jan 2002 09:08:03
Message: <chrishuff-66B74C.09085821012002@netplex.aussie.org>
In article <0tin4usrh1hbhf2td9the8l6l19rctr2e0@4ax.com>,
 W?odzimierz ABX Skiba <abx### [at] babilonorg> wrote:

> parsing is slowest part of  POV, such additional #if() could slow down simple
> loops  more then twice sometimes imo

Only if you only loop once, for example when you have two items, you 
might have an extra millisecond or so.

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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