Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    CSG - Constructive Solid Geometry -
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
- Download-Page

  - CSG Constructive
            Solid
            Geometry
    - union + merge
    - difference
   > intersection
       + invers
    - clipped_by
    - coincident surfaces
    - textures in CSG
                                           
Boolean Algebra with Solids - part IV

About "intersection" and "inverse"

intersection{...}

inverse


The statement "intersection{...}"
With two or more shapes it results in a shape which has an area that consists of the area common to all these shapes, the area where the objects are overlapping:

Sample "intersection":
intersection{
box {<-0.5,-0.5,-0.5>,< 0.5,0.5,0.5>
     texture{
       pigment{color rgb<1,0.65,0>}
       finish {phong 0.5}}
    }
sphere{<0,0,0>,0.66
     texture{
       pigment{color rgb<1,0,0>}
       finish {phong 0.5}}
    }
rotate<0,-30,0>
translate<0,0.5,0>
} // end of intersection ------------


The complement - "inverse"
With this statement it is possible to turn a shape's inside out.
Especially true is:
.
This is very useful in "differece" and "intersection"- it makes often things easier to describe in POV as the following sample shows:

Instead of: write shorter:
difference{ intersection {object{A}
                          object{B}
                         }
            object{C}
          }
intersection {object{A}
              object{B}
              object{C inverse}
             }

Sample "inverse":
intersection{
box{<-0.5,-0.5,-0.5>,<0.5,0.5,0.5>
     texture{/*see above*/} }
sphere{<0,0,0>,0.66
     texture{/*see above*/} }
cylinder{<0,0,-1>,<0,0,1>,0.3 inverse
     texture{pigment{color YellowGreen}
             finish {phong 0.5}}}
cylinder{<0,-1,0>,<0,1,0>,0.3 inverse
     texture{pigment{color YellowGreen}
             finish {phong 0.5}}}
cylinder{<-1,0,0>,<1,0,0>,0.3 inverse
     texture{pigment{color YellowGreen}
             finish {phong 0.5}}}
rotate<0,-30,0> translate<0,0.5,0>}


CSG | union + merge | difference | intersection + inverse | clipped_by | coincident surfaces | textures
top

© Friedrich A. Lohmüller, 2012
www.f-lohmueller.de