POV-Ray : Newsgroups : povray.text.scene-files : Planetarium : Re: Planetarium Server Time22 May 2024 01:33:04 EDT (-0400)
 Re: Planetarium
 From: Bald Eagle Date: 14 Sep 2018 09:40:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"dateCreated": "2018-09-14T13:40:01+00:00",
"datePublished": "2018-09-14T13:40:01+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
Mike Horvath <mik### [at] gmailcom> wrote:

> How do I split such a function into parts? For instance

What you can do is limit the range of U and V over which those functions are
evaluated.

If you limit U or V to the range from 0 to 0, then you will get a circle.
Swap U and V, and you get "the other" circle

Limit the ranges of both to a fraction of (2*pi), and you get a curved patch
that only covers part of the torus' surface.

Keep one full 2*pi range, and limit the other, and you get a "hoop sweep" around
the torus, one way or the other.

The set of macros takes this concept and just does it 4 times (0, +TStep,
+PStep, +both) to generate 4 corners, and fills that in with 2 smooth triangles.

https://nylander.wordpress.com/2008/08/25/cross-section-of-the-quintic-calabi-yau-manifold/

There is no magic.

Look back through the forums, and you can see that we've been exploring this
basic concept --- for years.

#version version;

#include "colors.inc"

light_source {
<5, 10, -20>
color White
}

camera {
location  <0, 2, -35>
look_at   <0, 0, -10>

right x*image_width/image_height
up y
}

#declare U1 = 0;   // small radius
#declare U2 = 2*pi;   //
#declare V1 = 0;   // large radius
#declare V2 = 2*pi;   //
#declare r0 = 10;
#declare r1 = 4;

// Create a set of points on the surface of a Torus
#declare X = function (T, P, R, r) {cos(T) * ( R + r * cos(P) )}
#declare Y = function (T, P, R, r) {-sin(T) * ( R + r * cos(P) )}
#declare Z = function (T, P, r, n) {r * sin(P)}

#declare TStep = 0.02;
#declare PStep = 0.05;

#for (Theta, U1, U2, TStep)
#for (Phi, V1, V2, PStep)
#local XYandZResultOfParametricFunctionsEvaluatedForThisImmediateUandV =
<X (Theta, Phi, r0, r1), Y (Theta, Phi, r0, r1), Z (Theta, Phi, r0, r1)>;
sphere {XYandZResultOfParametricFunctionsEvaluatedForThisImmediateUandV