Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Geometric Shapes in POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
Geometric Shapes
   Overview
Basic Shapes
Shapes by macro + CSG
Shapes in "shapes3.inc"
Other Shapes by macros
3D text shapes
Other Shapes
Non CSG Shapes
height_field + HF macros

Isosurfaces
  - with Basic Surfaces
  - with Sine Functions
  - by Built-in Functions
  - by Helix Functions
  ->by Pattern Functions
                                   
       isosurface{ ... } - by pattern functions. Examples:
          Built-in shape
isosurface
isosurface{ //-------------------------
  function{  f_checker( x*1.2,y*1.19,z*1.2)*0.08
          }
  contained_by{box{<-2,-3,-2>,<2,3,2>}}
  threshold 0.05
  max_gradient 200

  texture{
    pigment{ color rgb<1,1,1>*1.2}
            finish { phong 1 }
  } // end of texture
  scale <1,1,1>*0.35
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function{ f_rounded_box(x,y,z,0.25,1,1,1)
           -f_leopard(x*11,y*11,z*11)*0.25
   }
  threshold 0
  max_gradient 3.0
  accuracy 0.0001
  contained_by {box { -1.35, 1.35 }}

  texture{
    pigment{ color rgb<0.75,1.0,0.0>}
    finish { diffuse 0.75 specular 0.3
             phong 0.3 reflection 0.07}
  } // end of texture
  scale <1,1,1>*0.85
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function {  f_rounded_box(x,y,z,0.3,1.5,1.5,1.5)
             -f_leopard(x*6,y*6,z*6)*0.5
   }
  threshold 0
  max_gradient 2.449
  accuracy 0.0001
  contained_by {box { -2 , 2 }}

  texture {
    pigment{ color rgb<1,0.75,0>}
    finish { diffuse 0.75  specular 0.4
             phong 0.3 reflection 0.1}
  } // end of texture
  scale <1,1,1>*0.55
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function { f_rounded_box(x,y,z,0.3,1.9,0.9,0.9)
            -f_marble(x*3,y*2,z*2)*0.15
            -f_bumps(x*3,y*2,z*3)*0.75
  }
  accuracy 0.003
  max_gradient 5
  contained_by{box{ -3.5, 3.5 }}

  texture{
    pigment{ color rgb<0.85,0.15,0.23>}
    finish { phong 0.4 reflection 0.2}
  } // end of texture
  scale <1,1,1>*0.7
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function{ f_rounded_box( x, y, z,
                  0.3,  // radius of curvature
                  0.8,0.8,0.8) // scale<x,y,z>
           -f_crackle(x/0.4,y/0.4,z/0.4)*0.2
   }
  threshold 0
  max_gradient 3.2
  accuracy 0.0001
  contained_by{box{ -1.5, 1.5 }}

  texture{
    pigment{ color rgb<1.0,0.9,0.7>}
    normal { bumps 0.5 scale 0.05}
    finish { diffuse 0.75 specular 0.2
             phong 0.3}
  } // end of texture
  scale <1,1,1>*1
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function{  f_rounded_box( x*0.7, y, z,
                  0.3, // radius of curvature
                  0.8,0.8,0.8)// scale<x,y,z>
            -f_crackle(x*3,y*5,z*3)*0.85
   }
  threshold 0
  max_gradient 3.2
  accuracy 0.0001
  contained_by{box{ -1.5, 1.5 }}

  texture{
    pigment{ color rgb<1.0,0.75,0.5>}
            normal { bumps 0.5 scale 0.015}
            finish { phong 0.3}
  } // end of texture
  scale <1,1,1>*0.8
  rotate <0,0,0>
  translate <0,1,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function { f_rounded_box( x, y, z,
                  0.3, //  radius of curvature
                  1.4,0.9,0.9) // scale <x,y,z>
            -f_agate(x/2,y/4,z/4)*0.35
   }
  threshold 0
  max_gradient 3.2
  accuracy 0.0001
  contained_by{ box{<-2,-1,-1>*1.2,<2,1,1>*1.5}}

  texture{ pigment{ color rgb<1,0.75,0.55>*0.7}
            normal { bumps 0.5 scale 0.05}
            finish { phong 0.3}
  } // end of texture
  scale <1,1,1>*0.7
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function { f_rounded_box( x, y, z,
                           0.3, // radius of curvature
                           0.7,0.7,0.7)// scale <x,y,z>
            -f_agate( x, y, z)*0.5

          }
  threshold 0
  max_gradient 3.2
 contained_by{ box{-1.2,1.2}}

  texture{ pigment{ color rgb<0.85,0.65,0.55>*0.8}
           finish { phong 0.3 }
  } // end of texture
  scale <1,1,1>*1.0
  rotate <0, 0, 0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function { f_noise3d( x*2, y*2, z*2)-0.3
           }
  accuracy 0.002
  max_gradient 4
  contained_by{box{-2,2} }

  texture{ pigment{ color rgb<1,0.6,0.1>}
           finish { phong 1 reflection 0.2 }
  } // end of texture
  scale <1,1,1>*0.65
  rotate <90,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
#declare FBozo =  // -------------------------
 function{ pigment{ bozo scale 0.5
                    color_map{ [0 rgb 0]
                               [0.2 rgb 0.4]
                               [1 rgb 1]
                             }
                  }// end of pigment
          } // end of function "FBozo" -------

isosurface { //-------------------------------
  function  {
    FBozo(2*x,2*y,2*z).gray -0.5
  }
  accuracy 0.0001
  max_gradient 5
  contained_by { box { -1.2, 1.2 } }

  texture{
    pigment{ color rgb<1,0.3,0.3>}
    finish {  phong 1}
  } // end of texture
  scale <1,1,1>*0.8
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function{  sqrt( x*x + y*y+ z*z) - 0.5
            - f_noise3d( x*2, y*2, z*2 )*1.90
          }
  accuracy 0.002
  max_gradient 5
  contained_by { box { -2.5, 2.5 } }

  texture{
    pigment{ color rgb<1,0.4,0.0>}
    finish { phong 1 reflection 0.1 }
  } // end of texture
  scale <1,1,1>*0.75
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function {  sqrt(  0.5*x*x + y*y + z*z) - 0.85
  - f_noise3d( x*12, y*12, z*12 )
  }
  accuracy 0.002
  max_gradient 4
  contained_by { box { -2.5, 2.5 } }

  texture{
    pigment{ color rgb<0.45,0.9,0.1>}
    finish { phong 1 reflection 0.1 }
  } // end of texture
  scale <1,1,1>*0.75
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
isosurface{ //-------------------------
  function { f_sphere(x, y, z, 2.2)
   - ( -f_snoise3d(x*2, y*2, z*2)*0.75 )
  }
  contained_by { sphere {<0,0,0>, -3.3 } }
  accuracy 0.003
  max_gradient 5

  texture{
    pigment{ color rgb<0.4,0.3,0.25>}
    finish { phong 1  }
  } // end of texture
  scale <1,1,1>*0.6
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
#declare fn_Pigm=function {
    pigment {
      agate
      color_map {
        [0 color rgb 0]
        [1 color rgb 1]
      }
    }
  } // end of function fn_Pigm

isosurface {
  function{
   f_sphere(x, y, z, 2.3)
   -fn_Pigm(x/2, y/2, z/2).gray*0.65
  }
  contained_by { sphere {<0,0,0>, -3.3 } }
  accuracy 0.003
  max_gradient 5

  texture{
    pigment{ color rgb<0.8,0.65,0.45>}
    finish { phong 1  }
  } // end of texture
  scale <1,1,1>*0.5
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------
isosurface
#declare Flower=function { //--------------------------
   pigment {
      wood
      scale 0.5
      turbulence 0.3
      octaves 7
      lambda 0.5
      omega 0.5
      color_map {
          [0, rgb 0]
          [1, rgb 1]
       }
    }
 } // end of function "Flower(x,y,z)"-------------------

isosurface { //-----------------------------------------
    function{
       f_sphere(x*0.75,y,z,1)-(Flower(x,y,z).hf)*0.5
     }
    contained_by {sphere {0,2.5}}
    max_gradient 8.607

  texture{
    pigment{ color rgb<0.85,1,0>}
    finish { specular 0.1 roughness 0.5
             phong 0.5 reflection 0.2 }
  } // end of texture
  scale <1,1,1>*0.85
  rotate <0,0,0>
  translate <0,0,0>
} // end of isosurface ----------------

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