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.
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>} |
|
|
|