|
|
Sven Littkowski <I### [at] SvenLittkowskiname> wrote:
> Is such a torus-shaped media possible?
Sure.
A torus is defined by the implicit equation
(sqrt(pow(x,2)-pow(y,2))-pow(R,2)+pow(z,2) = pow(r,2)
So if you do
sqrt((sqrt(pow(x,2)-pow(y,2))-pow(R,2)+pow(z,2)) you get r
divide by r and you get a range of 1 at the center and 0 at the surface (what
you'd see if you made an isosurface with threshold 0
So your media function would be:
#declare Torus = function {sqrt((sqrt(pow(x,2)-pow(y,2))-pow(R,2)+pow(z,2))/r}
Post a reply to this message
|
|