Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller Geometric Shapes in POV-Ray Italiano Français 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
- blob
- sphere_sweep
- julia_fractal
- Regulare Polyhedron
- Paraboloid, Hyperboloid
- Polynomial equations
- Cubic & Quartic shapes
->Parametric shapes

Non CSG Shapes
height_field + HF macros
Isosurfaces

Parametric shapes
built-in object

Warning:
Mike Williams wrote in his great "Isosurface Tutorial" :
"Parametric surfaces render very slowly in POV-Ray ..." and unfortunately he is right!

Parametric equations are an alternative way of defining equations for 3d surfaces.
Syntax sample:
 ```// --- parametric surface --- parametric{ function{ u } //x(u,v) or x function{ u*v } //y(u,v) or f(x,z) function{ v } //z(u,v) or z <-1,-1>,<1,1> // start, end (u,v) contained_by{box{<-1,-1,-1>,<1,1,1>}} max_gradient 5 accuracy 0.0035 precompute 18 x,y,z texture{ pigment{ color rgb<1,1,1> *1.2} finish { phong 0.5 } } scale 0.5 rotate <0, 0, 0> translate < 0, 0.5, 0> } // end of parametric ------```
 ```parametric{ function{ sin(u) } // x(u,v) or x function{ cos(u) } // y(u,v) or f(x,z) function{ v } // z(u,v) or z <0,-2>,<2*pi,2> // start, end(u,v) contained_by {box {<-2,-2,-2>,<2,2,2>}} max_gradient 7 accuracy 0.005 precompute 18 x,y,z texture{ pigment{ color rgb<1,1,1>} finish { phong 0.5 }} scale 0.5 } // end of parametric ------``` ```parametric{ function{ sin(u)+0.25*sin(v*2*pi)} // x(u,v) function{ cos(u) } // y(u,v) function{ v } // z(u,v) <0,-2>,<2*pi,2> // start, end(u,v) contained_by {box {<-2,-2,-2>,<2,2,2>}} max_gradient 7 accuracy 0.005 precompute 18 x,y,z texture{ pigment{ color rgb<1,1,1>*.8} finish { phong 0.1 }} scale 0.5 } // end of parametric ------``` ``` parametric{ function{ u } //x(u,v) function{ 0.25*sin(u*2*pi)} //y(u,v) or f(x,z) function{ v } //z(u,v) <-4,-2>,<4,2> // start, end of (u,v) contained_by {box {<-1,-1,-1>,<1,1,1>}} max_gradient 2 accuracy 0.0035 precompute 18 x,y,z texture { pigment{ color rgb<1,1,1>*1.2} finish { phong 0.5 } } scale 0.5 } // end of parametric ------``` ``` parametric{ function{ u } //x(u,v) function{ 0.5*v*sin(u*2*pi)}//y(u,v) function{ v } //z(u,v) <-4,-2>,<4,2> // start, end (u,v) contained_by {box {<-1,-1,-1>,<1,1,1>}} max_gradient 5 accuracy 0.0035 precompute 18 x,y,z texture { pigment{ color rgb<1,1,1>*1.2} finish { phong 0.5 } } scale 0.5 } // end of parametric -----``` ``` parametric{ function{ u } //x(u,v) function{ 0.15*sin(u*4*pi) } //y(u,v) function{ v } //z(u,v) <-4,-2>,<4,2> // start, end of (u,v) contained_by {box {<-1,-1,-1>,<1,1,1>}} max_gradient 3 accuracy 0.0035 precompute 18 x,y,z texture { pigment{ color rgb<1,1,1>*1.2} finish { phong 0.5 } } scale 0.5 } // end of parametric -----``` ``` parametric{ function{ u } //x(u,v) or x function{ 0.05*(sin(v*4*pi)+sin(u*4*pi))} function{ v } //z(u,v) or z <-4,-2>,<4,2> // start, end of (u,v) contained_by {box {<-1,-1,-1>,<1,1,1>}} max_gradient 2 accuracy 0.0035 precompute 18 x,y,z texture { pigment{ color rgb<1,1,1>} finish { phong 0.5 } } scale 0.5 } // end of parametric -----``` Conical screw: ``` parametric{ function{ u*v*sin(15*v) } //x(u,v) function{ v } //y(u,v) function{ u*v*cos(15*v) } //z(u,v) <0,-1>,<1,1> // start, end (u,v) contained_by {box {<-1,-1,-1>,<1,1,1>}} max_gradient 5 accuracy 0.0035 precompute 18 x,y,z texture { pigment{ color rgb<1,1,1>*1.2} finish { phong 0.5 } } scale 0.5 } // end of parametric -----``` Conical spiral: ```#declare a = 1.0; #declare b = 8; #declare c = 0.2; #declare n = 5; parametric{ function { a*(1-0.5*v/pi)*sin(n*v+0.5*pi)*(1-cos(u)) + c*sin(n*v+0.5*pi) } function { b*0.5*v/pi + a*(1-0.5*v/pi)*sin(u) } function { a*(1-0.5*v/pi)*cos(n*v+0.5*pi)*(1-cos(u)) + c*cos(n*v+0.5*pi) } <0,0>,<2*pi,2*pi> // start, end of (u,v) contained_by {box {<-1,-1,-1>*2*pi,<1,b/3,1>*2*pi}} max_gradient 10 accuracy 0.0035 precompute 18 x,y,z texture{ pigment{ color rgb<1,1,1>} finish { phong 0.5}} scale 0.125 rotate <0, 90, 0> } // end of parametric -----``` Dini-Surface: ``` #declare a = 1; #declare b = 0.2; parametric{ function{ a*cos(u)*sin(v) } //x(u,v) function{ cos(v)+ln(tan(v/2))+b*u } //y(u,v) function{ a*sin(u)*sin(v) } //z(u,v) <0,0.0001>,<4*pi,2> // start, end (u,v) contained_by {box {<-1,-1,-1>*3,<1, 1, 1>*3}} max_gradient 5 accuracy 0.0035 precompute 18 x,y,z texture{ pigment{ color rgb<1,1,1>*1.2} finish { phong 0.5 }} scale 0.5 } // end of parametric -----```

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