POV-Ray : Newsgroups : povray.beta-test : Arrays.inc question Server Time
30 Jul 2024 18:16:37 EDT (-0400)
  Arrays.inc question (Message 1 to 7 of 7)  
From: Rune
Subject: Arrays.inc question
Date: 2 Oct 2001 16:40:07
Message: <3bba2627@news.povray.org>
Some of the macros in arrays.inc redefine array elements without using
semi-colons (;) in the end. This means that the macros work also if the data
in the arrays isn't floats or vectors. However, it also means that when
floats or vectors are used, lots of warnings are generated.

From my personal experience I've never needed arrays to contain anything
else than floats or vectors. And though there are many cases where it can be
useful to use other types of data in arrays, such as objects, the questions
is if the array manipulation macros are really needed in such cases? I can
only imagine the need to resize, reverse or sort an array that contains
floats or vectors, not other data.

But what do you think? Should semi-colons be added to the array macros?

The user can always modify the macros, so the question is what should be the
default set-up.

Rune


Post a reply to this message

From: Ron Parker
Subject: Re: Arrays.inc question
Date: 2 Oct 2001 16:45:24
Message: <slrn9rk9r6.fi5.ron.parker@fwi.com>
On Tue, 2 Oct 2001 22:40:56 +0200, Rune wrote:
>is if the array manipulation macros are really needed in such cases? I can
>only imagine the need to resize, reverse or sort an array that contains
>floats or vectors, not other data.

I can certainly imagine resizing an array of objects or reversing an
array of strings.

-- 
#local R=rgb 99;#local P=R-R;#local F=pigment{gradient x}box{0,1pigment{gradient
y pigment_map{[.5F pigment_map{[.3R][.3F color_map{[.15red 99][.15P]}rotate z*45
translate x]}]#local H=pigment{gradient y color_map{[.5P][.5R]}scale 1/3}[.5F
pigment_map{[.3R][.3H][.7H][.7R]}]}}}camera{location.5-3*z}//only my opinions


Post a reply to this message

From: Anders K 
Subject: Re: Arrays.inc question
Date: 2 Oct 2001 18:38:20
Message: <3bba41dc$1@news.povray.org>
> But what do you think? Should semi-colons be added to the array macros?

IMO, a better solution would be to optionally allow semicolons in the
language when declaring things other than floats or vectors!


Post a reply to this message

From: Warp
Subject: Re: Arrays.inc question
Date: 2 Oct 2001 20:12:26
Message: <3bba57ea@news.povray.org>
Anders K. <and### [at] f2scom> wrote:
: IMO, a better solution would be to optionally allow semicolons in the
: language when declaring things other than floats or vectors!

  I agree. Making generic macros which work with any item types is an
extremely good reason to add this.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Rune
Subject: Re: Arrays.inc question
Date: 3 Oct 2001 08:30:38
Message: <3bbb04ee$1@news.povray.org>
"Ron Parker" wrote:
> I can certainly imagine resizing an array of objects or
> reversing an array of strings.

I sure can imagine it too. The question is if anyone has ever actually
needed to do this.

And again, the question is about what should be the default behavior, as the
user can always modify the macros.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Rune
Subject: Re: Arrays.inc question
Date: 3 Oct 2001 08:30:40
Message: <3bbb04f0@news.povray.org>
"Anders K." wrote:
> IMO, a better solution would be to optionally allow
> semicolons in the language when declaring things
> other than floats or vectors!

I agree, but that's not an option here and now, so my question remains.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Christoph Hormann
Subject: Re: Arrays.inc question
Date: 3 Oct 2001 08:36:12
Message: <3BBB0704.731284@gmx.de>
Rune wrote:
> 
> I agree, but that's not an option here and now, so my question remains.
> 

The obvious solution would be making two versions - one with and one
without.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

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