|
|
With regard to my continuing interest in tori, esp the Clifford Torus, and their
relationship to the Dupin cyclide by geometric inversion, I was playing with
some inversion code, and ran into some strange artefacts.
Perhaps someone can see what's going on here. It seems very strange to lose
all of the objects above a straight line.
I had another instance where just the top right quadrant got wiped out.
#version 3.7;
global_settings{ assumed_gamma 1.0}
#include "colors.inc"
#include "math.inc"
sky_sphere {pigment {gradient <0,1,0>
color_map { [0.00 rgb <0.6,0.7,1.0>/2]
[0.25 rgb <0.0,0.1,0.8>/4]
[0.75 rgb <0.0,0.1,0.8>/4]
[1.00 rgb <0.6,0.7,1.0>/2]
}
scale 2
} // end of pigment
} //end of skysphere -------------------------------------
light_source { <-20, 100, -200>, 1 }
camera {
location <0, 0, -20>
up y
right x*image_width/image_height
look_at 0
}
#declare Line = 0.1;
#declare O = <0, 2, 0>;
#declare R = 3;
#declare Center = sphere {O, Line pigment {Green}}
#declare Circle_C = torus {R, Line pigment {Green} rotate x*90 translate O}
#macro Inverse (Point, CircleCenter, CircleRadius)
#local P = vnormalize (Point);
#local C = vnormalize (CircleCenter);
<(Point.x-CircleCenter.x)*(R*R)/(pow(Point.x-CircleCenter.x,
2)+pow(Point.y-CircleCenter.y, 2)+pow(Point.z-CircleCenter.z, 2)) +
CircleCenter.x,
(Point.y-CircleCenter.y)*(R*R)/(pow(Point.x-CircleCenter.x,
2)+pow(Point.y-CircleCenter.y, 2)+pow(Point.z-CircleCenter.z, 2)) +
CircleCenter.y,
(Point.z-CircleCenter.z)*(R*R)/(pow(Point.x-CircleCenter.x,
2)+pow(Point.y-CircleCenter.y, 2)+pow(Point.z-CircleCenter.z, 2)) +
CircleCenter.z>
#end
object {Center}
object {Circle_C}
#declare TCenter = <-4, 2, 0>;
#declare r0 = 2;
#declare r1 = 0.5;
// torus
#declare XT = function (TT, TP, TR, Tr) {(cos(TT) * ( TR + Tr * cos(TP) ))}
#declare YT = function (TT, TP, TR, Tr) {sin(TT) * ( TR + Tr * cos(TP) )}
#declare ZT = function (TP, Tr) {Tr * sin(TP)}
#for (Torus, 0, 1.5, 0.5)
#declare TCenter = TCenter + <Torus, 0, 0>;
#declare Steps = 180;
#for (Theta, 0, tau, tau/Steps)
#for (Phi, 0, tau, tau/Steps)
#declare X = XT (Theta, Phi, r0, r1) + TCenter.x;
#declare Y = YT (Theta, Phi, r0, r1) + TCenter.y;
#declare Z = ZT (Phi, r1) + TCenter.z;
//sphere {<X, Y, Z>, Line pigment {White}}
sphere {Inverse(<X, Y, Z>, O, R), Line pigment {Blue*Torus}}
#end
#end
#end
Post a reply to this message
Attachments:
Download 'inversiontest.png' (358 KB)
Preview of image 'inversiontest.png'
|
|