POV-Ray : Newsgroups : povray.newusers : Constructive Solid Geometry : Re: Constructive Solid Geometry Server Time
5 Nov 2024 07:17:04 EST (-0500)
  Re: Constructive Solid Geometry  
From: Ken
Date: 20 Mar 2000 19:06:58
Message: <38D6BD83.A1A21A46@pacbell.net>
CMcCabe wrote:
> 
> is it possible to subtract two shapes in a single difference statement?
> as in this:
> difference {
>   box1       //the box that is subtracted from
>   box2       //box1 has this shape subtracted from it
>   box3       //does box3 have this shape subtracted from it as well?
> }//end difference statement
> 
> and can anyone point me to a tutorial on csg?
> 
> Many thanks for any help,
> CMcCabe

It is easist to think of this way. Box 1 is the only object acted upon
in a csg operation (the first object in a csg operation). In the above
example box 1 will be acted upon by box 2 and box 3 but box 2 will not
be acted upon by box 3.

It is possible to nest csg operations - 

difference {
             union {
                    box1
                    box2
                   }
             box3
           }

In the above box 1 and box 2 are unioned together and then differenced
by box 3 so that box 1 and box 2 are both acted upon by box 3.

intersection {
               merge {
                        box 1
                        box 2
                     }
               box 3
             }

In the above box 1 is merged with box 2, and then box 1 and box 2,
are both intersected by box 3. You can use any combination and depth
of csg nesting to acheive the desired shape you are looking for.


POV-Ray tutorials can be found by following this link

http://www.povray.org/links/3D_Tutorials/POV-Ray_Tutorials/

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

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