---- DATABASE ERROR ----
The parametric object, in essence, renders the object by sweeping x from -1 to 1, z from -1 to 1, and calculating y = sin(x). The result shown above is be just what'd you expect from a 3d function with y = sin(x).
#declare Fx = function { u };
#declare Fy = function { sin(pi*u) };
#declare Fz = function { v };
#declare maxG = 2;
#declare startU = -1;
#declare startV = -1;
#declare endU = 1;
#declare endV = 1;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0 },
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full source
Cylindrical Coordinate System[1] |
Polar Coordinate System[2] |
Cartesian |
Cylindrical |
Polar |
x |
r * cos(theta) |
r * sin (phi) * cos(theta) |
y |
h |
r * cos(phi) |
z |
r * sin(theta) |
r * sin (phi) * sin(theta) |
In the first example, h = v and theta = u. We specify the lathe behavior by generating a radius, Fr, based on the current height. By sweeping theta from 0 to 2*pi, the line specified by r = ( 0.5*(h+1)) is revolved around the y axis.
#declare Fr = function { 0.8 };
#declare Fx = function { Fr(u,v,0)*cos(u) };
#declare Fy = function { v };
#declare Fz = function { Fr(u,v,0)*sin(u) };
#declare maxG = 1;
#declare startU = 0;
#declare startV = -1;
#declare endU = 2*pi;
#declare endV = 1;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0) }
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full Source
#declare Fr = function { 0.2 + 0.2*sin(5*pi*v) };
#declare Fx = function { Fr(u,v,0)*cos(u) };
#declare Fy = function { v };
#declare Fz = function { Fr(u,v,0)*sin(u) };
#declare maxG = 2;
#declare startU = 0;
#declare startV = -1;
#declare endU = 2*pi;
#declare endV = 1;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0) }
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full Source
#declare Fr = function { 0.2 + 0.2*sin(5*pi*v) };
#declare Fx = function { Fr(u,v,0)*cos(u) + 0.4*cos(4*v) };
#declare Fy = function { v };
#declare Fz = function { Fr(u,v,0)*sin(u) + 0.4*sin(4*v)};
#declare maxG = 2;
#declare startU = 0;
#declare startV = -1;
#declare endU = 2*pi;
#declare endV = 1;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0) }
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full Source
And now lets repeat that last object with manipulations to the radius function Fr. Just because the equations are written in a spherical system does not mean that the result will be spherical.
#declare Fr = function { 0.8 };
#declare Fx = function { Fr(u,v,0)*cos(u)*sin(v) };
#declare Fy = function { Fr(u,v,0)*cos(v)};
#declare Fz = function { Fr(u,v,0)*sin(u)*sin(v) };
#declare maxG = 2;
#declare startU = 0;
#declare startV = 0;
#declare endU = 2*pi;
#declare endV = pi;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0) }
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full Source
And now, a really busy Fr.
#declare Fr = function { 0.5 + 0.5*sin(10*v) };
#declare Fx = function { Fr(u,v,0)*cos(u)*sin(v) };
#declare Fy = function { Fr(u,v,0)*cos(v)};
#declare Fz = function { Fr(u,v,0)*sin(u)*sin(v) };
#declare maxG = 2;
#declare startU = 0;
#declare startV = 0;
#declare endU = 2*pi;
#declare endV = pi;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0) }
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
precompute 20 x,y,z
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full Source
With parametric objects, it's possible to produce some shapes that would be near-impossible to create using isosurfaces.
#declare Fr = function { 0.2 + 0.4*cos(13*u) + 0.4*sin(10*v) };
#declare Fx = function { Fr(u,v,0)*cos(u)*sin(v) };
#declare Fy = function { Fr(u,v,0)*cos(v)};
#declare Fz = function { Fr(u,v,0)*sin(u)*sin(v) };
#declare maxG = 4;
#declare startU = 0;
#declare startV = 0;
#declare endU = 2*pi;
#declare endV = pi;
parametric {
function { Fx(u,v,0) },
function { Fy(u,v,0) },
function { Fz(u,v,0) }
<startU, startV>, <endU, endV>
contained_by { box {<-1,-1,-1>,<1,1,1>} }
max_gradient maxG
precompute 20 x,y,z
pigment { rgb 0.9 }
finish { phong 0.5 phong_size 10 }
}
Full Source