POV-Ray : Newsgroups : povray.newusers : Merge vs. Union Server Time
28 Nov 2024 20:52:40 EST (-0500)
  Merge vs. Union (Message 1 to 10 of 27)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Ian Burgmyer
Subject: Merge vs. Union
Date: 17 Sep 1999 21:01:48
Message: <37e2e47c@news.povray.org>
What's the difference between merge and union?  I noticed that one (I think
it was merge) took quite a bit longer then the other.

Thanks!
-Ian


Post a reply to this message

From: Ken
Subject: Re: Merge vs. Union
Date: 17 Sep 1999 21:11:18
Message: <37E2E64C.45A876B0@pacbell.net>
Ian Burgmyer wrote:
> 
> What's the difference between merge and union?  I noticed that one (I think
> it was merge) took quite a bit longer then the other.
> 
> Thanks!
> -Ian

  There is a major difference between the two. The union is really not
a true CSG operation and could be more accurately described as a group
container. This makes it possible to combine several elements into one
item that can then be translated, rotated, and scaled as if they were
just on object.

  A merge operation on the otherhand is a true CSG operation and has
specific uses. The main feature of a merge operation is that it will
remove the interior surfaces of over lapping objects. This is useful
it you don't want a "cell" effect when over lapping several objects
since the merge operation removes all internal faces. You will in most
cases use this operation only when using clear objects but the are some
special cases where you can use it with solid colored objects as well.
I would have to dig deep to give you an example of the last but would
gladly do so if you are interested.

-- 
Ken Tyler

See my 1000+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

From: Ian Burgmyer
Subject: Re: Merge vs. Union
Date: 18 Sep 1999 00:51:53
Message: <37e31a69@news.povray.org>
>   There is a major difference between the two. The union is really not
> a true CSG operation and could be more accurately described as a group
> container. This makes it possible to combine several elements into one
> item that can then be translated, rotated, and scaled as if they were
> just on object.

In other words, just use a group in Moray ;)

>   A merge operation on the otherhand is a true CSG operation and has
> specific uses. The main feature of a merge operation is that it will
> remove the interior surfaces of over lapping objects. This is useful
> it you don't want a "cell" effect when over lapping several objects
> since the merge operation removes all internal faces. You will in most
> cases use this operation only when using clear objects but the are some
> special cases where you can use it with solid colored objects as well.
> I would have to dig deep to give you an example of the last but would
> gladly do so if you are interested.

Yeah, I'm interested!  I'd like to see how the merge operation ticks.

Don't go through too much trouble, though :)

Thanks!
-Ian


Post a reply to this message

From: Ken
Subject: Re: Merge vs. Union
Date: 18 Sep 1999 01:16:11
Message: <37E31FAD.AB86518A@pacbell.net>
Ian Burgmyer wrote:

> In other words, just use a group in Moray ;)

sigh ! A modeller user.
 
> >   A merge operation on the otherhand is a true CSG operation and has
> > specific uses. The main feature of a merge operation is that it will
> > remove the interior surfaces of over lapping objects. This is useful
> > it you don't want a "cell" effect when over lapping several objects
> > since the merge operation removes all internal faces. You will in most
> > cases use this operation only when using clear objects but the are some
> > special cases where you can use it with solid colored objects as well.
> > I would have to dig deep to give you an example of the last but would
> > gladly do so if you are interested.
> 
> Yeah, I'm interested!  I'd like to see how the merge operation ticks.
> 
> Don't go through too much trouble, though :)
> 
> Thanks!
> -Ian

Found it. This example is excellent for this thread because it uses both
a union to group together cones with and then uses the merge function in
a non typical usage that clears the inside surfaces. I will leave it as
an experiment to the user to find out why it works. Test in 1 week...

// Super neat geometric shape using the merge function
#declare SnowTex = 
  texture {
   pigment { rgb 1 }
     finish {
               crand      0.1
               ambient    0.6
               diffuse    0.2
               specular   1
               roughness  0.001
               brilliance 2
               reflection 0.02
     }
  }

#declare MB = 
 union {
        cone { <0,0,0>,1.3,< 0, 1, 0>,-0.25 open}
        cone { <0,0,0>,1.3,< 0,-1, 0>,-0.25 open}
        cone { <0,0,0>,1.3,< 1, 0, 0>,-0.25 open}
        cone { <0,0,0>,1.3,<-1, 0, 0>,-0.25 open}
        cone { <0,0,0>,1.3,< 0, 0, 1>,-0.25 open}
        cone { <0,0,0>,1.3,< 0, 0,-1>,-0.25 open}
 }

#declare Fk = 
 merge {
        sphere { <0,0,0>,1.1   }
        object { MB rotate  0*y}
        object { MB rotate 45*z}
        object { MB rotate 45*y}
        object { MB rotate 45*x}
 }

 object { Fk
  texture { SnowTex }
  scale 2
 }

camera { location<0,0,-9> look_at 0}

light_source { < 100,225,-200> rgb 1}

Enjoy,

-- 
Ken Tyler

See my 1000+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

From: Ian Burgmyer
Subject: Re: Merge vs. Union
Date: 18 Sep 1999 17:11:53
Message: <37e40019@news.povray.org>
> I will leave it as
> an experiment to the user to find out why it works. Test in 1 week...

I think I know.  Is it because the geometry of the objects in the merge CSG
block are not traced?

I did a little checking and experimenting with the image.  Then, I did a tad
bit of research in the manual to confirm my findings.

-Ian


Post a reply to this message

From: Bob Hughes
Subject: Re: Merge vs. Union
Date: 18 Sep 1999 18:19:08
Message: <37e40fdc@news.povray.org>
Think the proper term might be  /inversed clipped_by/  seeing as how
there are no structures left within the bounds of the master object.
That is to say, no surfaces exist unlike using a form of
'intersection' or 'difference' (the only pair of things everything
else seems to be based on when "cutting").
Just happened to think, if a unioned CSG is completely opaque is there
no ray testing done within said CSG?  Sure this has been asked a
thousand times before so maybe it's in the VFAQ, I'll go look  : )

Bob

Ian Burgmyer <the### [at] hotmailcom> wrote in message
news:37e40019@news.povray.org...
> > I will leave it as
> > an experiment to the user to find out why it works. Test in 1
week...
>
> I think I know.  Is it because the geometry of the objects in the
merge CSG
> block are not traced?
>
> I did a little checking and experimenting with the image.  Then, I
did a tad
> bit of research in the manual to confirm my findings.
>
> -Ian
>
>


Post a reply to this message

From: Nieminen Juha
Subject: Re: Merge vs. Union
Date: 19 Sep 1999 05:17:31
Message: <37e4aa2b@news.povray.org>
Bob Hughes <inv### [at] aolcom> wrote:
: Just happened to think, if a unioned CSG is completely opaque is there
: no ray testing done within said CSG?

  AFAIK when you shoot a ray, you get _all_ the intersections of that ray
and every surface it hits.
  That's why shadow calculations of semi-transparent objects are so fast and
max_trace_level independent.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Merge vs. Union
Date: 19 Sep 1999 22:10:20
Message: <37e69793.512083187@news.povray.org>
On Fri, 17 Sep 1999 18:09:32 -0700, Ken <tyl### [at] pacbellnet> wrote:

>
>
>Ian Burgmyer wrote:
>> 
>> What's the difference between merge and union?  I noticed that one (I think
>> it was merge) took quite a bit longer then the other.
>> 
>> Thanks!
>> -Ian
>
>  There is a major difference between the two. The union is really not
>a true CSG operation and could be more accurately described as a group
>container.

Interesting distinction you make there.  I'd say union is the true
CSG operation - since it's what we'd generally consider atomic - and 
merge is the imposter; it's able to be synthesized by clever
combination of intersection and inverse.


Post a reply to this message

From: Ron Parker
Subject: Re: Merge vs. Union
Date: 19 Sep 1999 22:12:12
Message: <37e79852.512273962@news.povray.org>
On 19 Sep 1999 05:17:31 -0400, Nieminen Juha <war### [at] cctutfi> wrote:

>  AFAIK when you shoot a ray, you get _all_ the intersections of that ray
>and every surface it hits.

In most cases, yes.  Not in the case of meshes, though.  It's also
possible that POV automatically ignores objects that are entirely
further away than the closest intersection so far.  If it doesn't,
it should.


Post a reply to this message

From: Ken
Subject: Re: Merge vs. Union
Date: 19 Sep 1999 23:12:43
Message: <37E5A5A9.5D290840@pacbell.net>
Ron Parker wrote:

> >  There is a major difference between the two. The union is really not
> >a true CSG operation and could be more accurately described as a group
> >container.
> 
> Interesting distinction you make there.  I'd say union is the true
> CSG operation - since it's what we'd generally consider atomic - and
> merge is the imposter; it's able to be synthesized by clever
> combination of intersection and inverse.

  Since I was responding to a question in the new users group I defend my
reply as appropriate for conveying a new concept. Had he asked for info
on and, or, and not operations I probably would have remained silent and
would have let you answer it yourself.

  I like to think of CSG operations as to how they perform physically in
an operation. My idea of more better analogies would be:

union        = gluing
intersection = cutting
difference   = scooping
merge        = melting and gluing
clipping     = cutting and hollowing
inverse      = inside outing

There ! That should give you something to cry in despair over for a while :)

-- 
Ken Tyler

See my 1000+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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