Difference between revisions of "Reference:Parametric"
Jump to navigation
Jump to search
Jholsenback (talk | contribs) m (more markup changes) |
Jholsenback (talk | contribs) m (one more point) |
||
| Line 43: | Line 43: | ||
<ol type="a"> | <ol type="a"> | ||
<li>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</li> | <li>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</li> | ||
| − | <li>The <code>max_gradient</code> | + | <li>The <code>max_gradient</code> should be at least the maximum (absolute value) of all of those values.</li> |
| + | <li>Choosing a <em>too small</em> of a value will create holes or artifacts in the object.</li> | ||
</ol> | </ol> | ||
<li>For <code>accuracy</code> smaller values produces more accurate surfaces, but take longer to render.</li> | <li>For <code>accuracy</code> smaller values produces more accurate surfaces, but take longer to render.</li> | ||
Revision as of 00:12, 22 November 2016
While the isosurface object uses implicit surface functions like F(x,y,z) = 0 the parametric object uses is a set of equations for a surface expressed in the form of the parameters that locate points on the surface. For example: x(u,v), y(u,v), z(u,v). Each of the pairs of values for u and v gives a single point <x,y,z> in 3d space.
The parametric object is not a solid it is hollow, like a thin shell. The syntax is as follows:
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]
}
The default values are:
accuracy : 0.001
contained_by : box {<-1,-1,-1>, <1,1,1>}
- The first function calculates the
xvalue of the surface, the secondyand the third thezvalue. Any function that results in a float is allowed. - The
<u1,v1>and the<u2,v2>boundaries of the(u,v)space, in which the surface has to be calculated. - The
contained_byobject limits the area where POV-Ray samples for the surface of the function. The container can either be asphereor abox. - The
max_gradientis the maximum magnitude of all six partial derivatives over the specified ranges of u and v. - Take
dx/du,dx/dv,dy/du,dy/dv,dz/du, anddz/dvand calculate them over the entire range - The
max_gradientshould be at least the maximum (absolute value) of all of those values. - Choosing a too small of a value will create holes or artifacts in the object.
- For
accuracysmaller values produces more accurate surfaces, but take longer to render. - Using
precomputecan speedup the rendering of parametric surfaces by simply dividing the parametric surfaces into smaller ones - The maximum value for DEPTH is 20. High values of depth can produce arrays that use a lot of memory, take longer to parse and render.
- It precomputes the ranges for the VarList variables (x,y,z)
- If you declare a
parametricsurface usingprecomputeand then use it twice, all arrays are in memory only once.
Example, a unit sphere:
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}
}