POV-Ray : Newsgroups : povray.advanced-users : Dupin cyclide by inversion Server Time 9 Sep 2024 15:22:47 EDT (-0400)
 Dupin cyclide by inversion (Message 1 to 1 of 1)
 From: Bald Eagle Subject: Dupin cyclide by inversion Date: 2 Aug 2024 20:15:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"dateCreated": "2024-08-03T00:15:00+00:00",
"datePublished": "2024-08-03T00:15:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
So, I was exploring various ideas, and came back around to my Dupin cyclide work
(with much help from Jerome Grimbert).

Now that I have a better understanding of inversion through a sphere, and some
working code to make that happen, I wanted to make further progress on
parameterizing the process so that given any two 3D points, a Dupin cyclide
would pass through those two points, with exactly specified cross-sectional

I have the "forward inversion" working well - turning a torus into a cyclide.

I can calculate the centers and radii of the cross-sectional circles, and verify
that the calculated cyclide's center is equidistant from those two centers.

Now I just need to reverse-engineer all of that to create the appropriate torus
from the design parameters of the cyclide.  Then when that gets inverted through
the sphere, I get the desired cyclide.  I might also be able to do this using a
cylinder or a cone.

One thing I did notice while doing development was that I was unable to
(consistently) properly render a torus using an isosurface of the equation
#declare Torus = function (X, Y, Z, R, r) {pow (sqrt((pow(X,2)+pow(Y,2)) - R),
2) + pow (Z,2) - pow (r,2)}
And the result changed when I simply included the grid-textured plane!  :O

So something is amiss there.

One thing of note:  I initially was trying to invert the coordinates fed into
the isosurface, but that obviously won;t work, because what I actually need to
do is invert the surface coordinates where the function equals zero.

Maybe there's still some tricky way to get that to work, but using parametric
equations and making a mesh was easier and faster.

Also of note (again) - the Dupin cyclide function in functions.inc actually
works by inverting a torus!  :O

#declare f_dupin_cyclid = function { internal(16) }
// Parameters: x, y, z
// Six extra parameters required:
// 1. Field Strength
// 2. Major radius of torus
// 3. Minor radius of torus
// 4. X displacement of torus
// 5. Y displacement of torus