Message Boards Message Boards

[GIF] Septafoil (Stereographic Projection of a Septafoil Knot)


Stereographic projection of spheres along a septafoil knot


This is the same idea as Intertwine, but with the septafoil knot $7_1$ rather than the trefoil knot. Read the post on Intertwine for more details on the code, which is mostly identical. The one notable change is that I've added noise to each of the frames in the animation. This is accomplished by creating a single noisy image of the right size:

noise = ImageEffect[Graphics[Background -> None, ImageSize -> 540], {"PoissonNoise", .4}];

and then combining it with each frame using ImageMultiply. Also, after exporting I reduced the color palette to 40 colors and dithered the frames using gifsicle.

Here's the rest of the code (as with Intertwine, I used MaxRecursion -> 5 for the final export, but this is too computationally intensive to use inside Manipulate):

Stereo3D[{x1_, y1_, x2_, y2_}] := {x1/(1 - y2), y1/(1 - y2), x2/(1 - y2)};

pqtorus[t_, θ_, p_, q_] := 1/Sqrt[2] Flatten[ReIm /@ {E^(p I (t + θ/p)), E^(q I t)}];

DynamicModule[{p = 7, q = 2, n = 50, 
  viewpoint = 10. {Cos[-4 π/5], Sin[-4 π/5], 0}, point, basis,
   sphere, cols = RGBColor /@ {"#7AC7C4", "#F73859", "#384259"}},
 point[t_, θ_] := pqtorus[t + θ, 0, p, q];
 basis[t_, θ_] := NullSpace[{point[t, θ]}];
 sphere[t_, θ_, ψ_, ϕ_] := 
  Cos[.1] point[t, θ] + Sin[.1] Total[{Cos[ψ] Sin[ϕ], Sin[ψ] Sin[ϕ], Cos[ϕ]}*basis[t, θ]];
     Table[Stereo3D[sphere[t, θ, ψ, ϕ]], {t, 0., 2 π - 2 π/(q n), 2 π/(q n)}],
    {ψ, 0, π}, {ϕ, 0, 2 π},
    Mesh -> None, PlotRange -> 4, ViewPoint -> viewpoint, 
    ViewAngle -> π/80, ImageSize -> 540, Boxed -> False, 
    PlotStyle -> White, ViewVertical -> {0, 0, 1}, Axes -> None, 
    Background -> cols[[-1]],
    Lighting -> {{"Point", cols[[1]], 2 {Cos[7 π/10], Sin[7 π/10], 0}}, 
       {"Point", cols[[2]], 2 {Cos[17 π/10], Sin[17 π/10], 0}} , 
       {"Ambient", cols[[-1]], viewpoint}}],
  {θ, 0, 2 π/(q n)}]
POSTED BY: Clayton Shonkwiler
11 months ago

Group Abstract Group Abstract