<!-- This file copyright Persistence of Vision Raytracer Pty. Ltd. 2003-2004 --> <html> <head> <!-- NOTE: In order to users to help find information about POV-Ray using --> <!-- web search engines, we ask you to *not* let them index documentation --> <!-- mirrors because effectively, when searching, users will get hundreds --> <!-- of results containing the same information! For this reason, the two --> <!-- meta tags below disable archiving and indexing of this page by all --> <!-- search engines that support these meta tags. --> <meta content="noarchive" name="robots"> <meta content="noindex" name="robots"> <meta content="no-cache" http-equiv="Pragma"> <meta content="0" http-equiv="expires"> <title>3.4.5 Parametric Object</title> <link href="povray35.css" rel="stylesheet" type="text/css"> </head> <body> <table class="NavBar" width="100%"> <tr> <td align="left" nowrap="" valign="middle" width="32"> <a href="s_108.html"><img alt="previous" border="0" src="prev.png"></a> </td> <td align="left" valign="middle" width="30%"> <a href="s_108.html">3.4.4 Isosurface Object</a> </td> <td align="center" valign="middle"> <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>3.4.5 Parametric Object</strong> </td> <td align="right" valign="middle" width="30%"> <a href="s_110.html">3.4.6 Constructive Solid Geometry</a> </td> <td align="right" nowrap="" valign="middle" width="32"> <a href="s_110.html"><img alt="next" border="0" src="next.png"></a> </td> </tr> </table> <h3><a name="s03_04_05">3.4.5 </a>Parametric Object</h3> <a name="s03_04_05_i1"><a name="parametric"></a><a name="s03_04_05_i2"><a name="parametric, keyword"></a><a name="s03_04_05_i3"><a name="s03_04_05_i4"><a name="function, parametric"></a><a name="s03_04_05_i5"><a name="s03_04_05_i6"><a name="contained_by, parametric"></a><a name="s03_04_05_i7"><a name="s03_04_05_i8"><a name="max_gradient, parametric"></a><a name="s03_04_05_i9"><a name="s03_04_05_i10"><a name="accuracy, parametric"></a><a name="s03_04_05_i11"><a name="s03_04_05_i12"><a name="precompute, parametric"></a><a name="s03_04_05_i13"> <p> Where the isosurface object uses implicit surface functions, F(x,y,z)=0, the parametric object is a set of equations for a surface expressed in the form of the parameters that locate points on the surface, x(u,v), y(u,v), z(u,v). Each pair of values for u and v gives a single point <code><x,y,z></code> in 3d space </p> <p> The parametric object is not a solid object it is "hollow", like a thin shell. </p> <p> Syntax: </p> <pre> parametric { function { FUNCTION_ITEMS }, function { FUNCTION_ITEMS }, function { FUNCTION_ITEMS } <u1,v1>, <u2,v2> [contained_by { SPHERE | BOX }] [max_gradient FLOAT_VALUE] [accuracy FLOAT_VALUE] [precompute DEPTH, VarList] } </pre> <p> Parametric default values: <a name="s03_04_05_i14"> </p> <pre> accuracy : 0.001 </pre> <p> The first function calculates the <code>x</code> value of the surface, the second <code>y</code> and the third the <code>z</code> value. Allowed is any function that results in a float. </p> <p> <code><u1,v1>,<u2,v2></code> boundaries of the <code>(u,v)</code> space, in which the surface has to be calculated<a name="s03_04_05_i15"> </p> <p> <code>contained_by { ... }</code> The contained_by 'object' limits the area where POV-Ray samples for the surface of the function. This container can either be a sphere or a box, both of which use the standard POV-Ray syntax. If not specified a <code>box {<-1,-1,-1>, <1,1,1>}</code> will be used as default.<a name="s03_04_05_i16"> </p> <p> <code>max_gradient</code>, It is not really the maximum gradient. It's the maximum magnitude of all six partial derivatives over the specified ranges of u and v. That is, if you take <code>dx/du</code>, <code>dx/dv</code>, <code>dy/du</code>, <code>dy/dv</code>, <code>dz/du</code>, and <code>dz/dv</code> and calculate them over the entire range, the <code>max_gradient</code> is the maximum of the absolute values of all of those values. <a name="s03_04_05_i17"> </p> <p> <code>accuracy</code> The default value is 0.001. Smaller values produces more accurate surfaces, but take longer to render.<a name="s03_04_05_i18"><a name="precompute"></a> </p> <p> <code>precompute</code> can speedup rendering of parametric surfaces. It simply divides parametric surfaces into small ones (2^depth) and precomputes ranges of the variables(x,y,z) which you specify after depth. The maximum depth is 20. High values of depth can produce arrays that use a lot of memory, take longer to parse and render faster. If you declare a parametric surface with the precompute keyword and then use it twice, all arrays are in memory only once. </p> <p> Example, a unit sphere: </p> <pre> parametric { function { sin(u)*cos(v) } function { sin(u)*sin(v) } function { cos(u) } <0,0>, <2*pi,pi> contained_by { sphere{0, 1.1} } max_gradient ?? accuracy 0.0001 precompute 10 x,y,z pigment {rgb 1} } </pre> <br> <table class="NavBar" width="100%"> <tr> <td align="left" nowrap="" valign="middle" width="32"> <a href="s_108.html"><img alt="previous" border="0" src="prev.png"></a> </td> <td align="left" valign="middle" width="30%"> <a href="s_108.html">3.4.4 Isosurface Object</a> </td> <td align="center" valign="middle"> <strong>3.4.5 Parametric Object</strong> </td> <td align="right" valign="middle" width="30%"> <a href="s_110.html">3.4.6 Constructive Solid Geometry</a> </td> <td align="right" nowrap="" valign="middle" width="32"> <a href="s_110.html"><img alt="next" border="0" src="next.png"></a> </td> </tr> </table> </body> </html>