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 VII

The Coincident-Surface Problems

Problems which may occure with structured textures like wood textures and csg objects:
If we connect shapes by "union" the different parts of the shapes keep their original textures.
If we are modeling shapes by "difference" and/or "intersection" the resulting shape will have the texture of the shapes that we have cut away right at those parts where they were subtracted.
If we want to have a continuous structured texture on such a csg object, then the texture should be applied at the end, after combining them by union, difference or intersection, for all combined elements together. This is not only much more easier to write but also garanties continuousity of the structured texture.

Samples:
Textures of a "difference"
difference{
  box   { <0,0,0>,<1,1,1>
          texture{ My_YellowGreen}
        }
  sphere{ <0,0,0>,0.5
          texture{ My_Yellow }
          translate<1,1,0>
        }
}// end of difference -------------
Interrupted grain
difference{
  box   { <0,0,0>,<1,1,1>
          texture{ My_Wood }
        }
  sphere{ <0,0,0>,0.5
          texture{ My_Wood }
          translate<1,1,0>
        }
}// end of difference -------------
Continuous grain
parts without texture,
applying a common texture at the end.
difference{
  box   { <0,0,0>,<1,1,1>
        }
  sphere{ <0,0,0>,0.5
          translate<1,1,0>
        }
  texture{ My_Wood }
}// end of difference -------------
Continuous grain
Using "cutaway_textures",
The texture of basic shapes will be applied.
difference{
  box   { <0,0,0>,<1,1,1>
          texture{ My_Wood }
        }
  sphere{ <0,0,0>,0.5
          translate<1,1,0>
        }
 cutaway_textures
}// end of difference -------------


Textures of a "difference"
 
Interrupted grain
 
Continuous grain

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

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