
There is a considerable collection of built in functions.
The simplest such function is the sphere, which can be used like this:
#include "functions.inc"
isosurface {
function { f_sphere(x,y,z,1) }
accuracy 0.001
contained_by{sphere{0,1.2}}
pigment {rgb .9}
}
Which gives exactly the same results as you would get by using a
conventional sphere {0, 1} object or using the
mathematical isosurface function { x*x + y*y + z*z  1 } .
The ,1 is a parameter that gets applied to the built in function.
In the case of a sphere, the parameter sets the radius.


To perform the intersection of two built in isosurfaces, we
take the max() of the two function, like this
function {max(f_torus(x,y,z,1, 0.3),
f_sphere(x,y+0.5,z,1))}
Notice that it also possible to perform variable substitution at the same time.
In this case the sphere has been shifted down by using "y+0.5" instead of "y".


Some built in functions are not surfaces when used alone, and
are only useful when combined with other surfaces.
f_th() is one such function.
f_th() produces a value which is equal to the "theta" angle,
in radians, at any point. The theta angle is like the longitude coordinate
on the Earth. It stays the same as you move north or south, but varies
from east to west.
The functions f_r(), f_th() and f_ph() are equivalent to the standard
3d polar coordinates Radius, Theta and Phi.
This surface is a sphere to which has been added a height that's proportional to sin(theta),
but which also decreases as you get near the poles (otherwise the ridges look out of proportion
when the come close together).
#declare Theta = function{f_th(x,y,z)}
#declare Sphere = function{f_sphere(x,y,z,1)}
isosurface {
function { Sphere(x,y,z)
+ sin(Theta(x,y,z)*20)*0.05*(1y*y) }


Here's a nice teardrop shape, called "Glob".
isosurface {
function {  f_glob(x,y,z,0.1) }
max_gradient 2
contained_by{sphere{0,1.2}}
pigment {rgb .9}
finish {phong 0.5 phong_size 10}
}
One part of this surface would actually go off to infinity if it were not restricted by the
contained_by shape. It's possible to select just the teardrop part by choosing the contained_by
shape appropriately.
