POV-Ray : Newsgroups : povray.advanced-users : union of unions Server Time
29 Jul 2024 10:24:45 EDT (-0400)
  union of unions (Message 1 to 10 of 43)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Herman Serras
Subject: union of unions
Date: 8 Sep 2002 08:38:43
Message: <3D7B4516.C68C4B79@pandora.be>
Is it possible to define a union of unions? I don't succeed in doing
this.
-- 
Herman Serras
http://cage.rug.ac.be/~hs/


Post a reply to this message

From: Gilles Tran
Subject: Re: union of unions
Date: 8 Sep 2002 08:53:59
Message: <3d7b4867$1@news.povray.org>

3D7B4516.C68C4B79@pandora.be...
> Is it possible to define a union of unions? I don't succeed in doing
> this.

You probably forgot a closing "}" somewhere.
Since you're using the windows version, check this by using the "Match
brace" command (Search>Match brace)
union{
    union{

    }
}
G.


--
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Warp
Subject: Re: union of unions
Date: 8 Sep 2002 18:04:33
Message: <3d7bc971@news.povray.org>
Gilles Tran <git### [at] wanadoofr> wrote:
> union{
>     union{

>     }
> }

  This is nitpicking, but IMHO it's easier to spot matching brackets when
they are in the same column, ie:

union
{
    union
    {
        ...
    }
}

  (It might take one extra line per bracket pair, but if it makes the source
more readable, that's perfectly ok IMO.)

-- 
#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: Gilles Tran
Subject: Re: union of unions
Date: 8 Sep 2002 19:10:54
Message: <3d7bd8fe@news.povray.org>

3d7bc971@news.povray.org...
>   (It might take one extra line per bracket pair, but if it makes the
source
> more readable, that's perfectly ok IMO.)

Well yes, perhaps I should try this if it's more practical. I never liked it
for some reason (mostly because the extra lines I presume, I started coding
POV-Ray script on small MS-DOS displays, so extra lines did matter) but
since I change my coding and variable naming style every couple of years why
not. That's what I use for php anyway...

G.


--
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Slime
Subject: Re: union of unions
Date: 8 Sep 2002 19:14:13
Message: <3d7bd9c5$1@news.povray.org>
>   This is nitpicking, but IMHO it's easier to spot matching brackets when
> they are in the same column

I used to do this myself, and hated the other method... now, suddenly, I
find myself doing it the other way in POV-Ray, and occasionally in other
languages inside small if blocks.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Christopher James Huff
Subject: Re: union of unions
Date: 8 Sep 2002 21:04:01
Message: <chrishuff-179005.21032908092002@netplex.aussie.org>
In article <3d7bd9c5$1@news.povray.org>, "Slime" <slm### [at] slimelandcom> 
wrote:

> >   This is nitpicking, but IMHO it's easier to spot matching brackets when
> > they are in the same column
> 
> I used to do this myself, and hated the other method... now, suddenly, I
> find myself doing it the other way in POV-Ray, and occasionally in other
> languages inside small if blocks.

I use the "{ at end of starting line" method in POV-Ray, Java, and 
Sapphire, but I use the "{ on new line" method in C and C++. I haven't 
really settled on one for Objective C, but the first method seems more 
common in existing Objective C code.

-- 
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: Rafal 'Raf256' Maj
Subject: Re: union of unions
Date: 8 Sep 2002 22:13:28
Message: <Xns92842A480AB4Eraf256com@204.213.191.226>
"Gilles Tran" <git### [at] wanadoofr> wrote in
news:3d7b4867$1@news.povray.org 

> You probably forgot a closing "}" somewhere.
> Since you're using the windows version, check this by using the "Match
> brace" command (Search>Match brace)
> union{
>     union{
> 
>     }
> }

using #declare or maybe includes can help in complex scenes

#declare roof = union { ...  }

union { // My House
  object { roof }
  #include "peoples.inc"
}

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Fidel viegas
Subject: Re: union of unions
Date: 9 Sep 2002 06:41:39
Message: <B9A23891.47D1%fidel.viegas@artrecognition.co.uk>
in article 3d7bd9c5$1@news.povray.org, Slime at slm### [at] slimelandcom wrote on
9/9/02 12:14 am:

> This is nitpicking, but IMHO it's easier to spot matching brackets when
> they are in the same column

When I started programming in C, that was how I used to write my code. But
now, I just find it ugly for some reason. It is definitely easier to read,
but just can't get used to it no more.

All the best

Fidel.


Post a reply to this message

From: Rune
Subject: Re: union of unions
Date: 9 Sep 2002 17:45:18
Message: <3d7d166e@news.povray.org>
Warp wrote:
>   This is nitpicking, but IMHO it's easier to spot matching brackets
> when they are in the same column, ie:

It is impossible to come with any objective arguments that this is in
fact more easy, readable or effective to use. To me, I spot that the
start of the union keyword is on the same level as the end bracket.

And don't forget that I once caught you in posting some code with a
missing bracket, while that has never happened for me... ;)

Also, there will be more consistence in POV-Ray code made by different
people if more people stick to the style used in the vast majority of
the POV-Ray documentation and scene files.

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated Sep 8)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Warp
Subject: Re: union of unions
Date: 9 Sep 2002 18:51:56
Message: <3d7d260c@news.povray.org>
Rune <run### [at] mobilixnetdk> wrote:
> It is impossible to come with any objective arguments that this is in
> fact more easy, readable or effective to use. To me, I spot that the
> start of the union keyword is on the same level as the end bracket.

  I don't know about you, but to me it's easier to spot an opening bracket
at the same column as the closing one I'm looking the pair for, than
distinguishing that some word is at the same column (specially when
there are several blocks one inside another).

> Also, there will be more consistence in POV-Ray code made by different
> people if more people stick to the style used in the vast majority of
> the POV-Ray documentation and scene files.

  Have you actually looked at the documentation? For example look at the
primitives documentation (6.5). About half of the examples are indented
in one way and the other half in the other way.

  Even if "the vast majority" of people use that indentation style, that
doesn't automatically make it good.

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

Goto Latest 10 Messages Next 10 Messages >>>

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