new icn messageflickr-free-ic3d pan white
Torus / 輪環(りんかん) | by TANAKA Juuyoh (田中十洋)
Back to group

Torus / 輪環(りんかん)

(* === Following code of Mathematica 8 generates this image. === *)

 

a = 10; (* center hole size of a torus *)

b1 = 5;(* the number of angles *)

b2 = 4;(* the number of waves *)

b3 = 3; (* the number of knots *)

c = 0; (* distance from the center of rotation *)

d = 1; (* the number of tori *)

h1 = 5; (* width of a torus *)

h2 = 5; (* width of a torus *)

h3 = 3;(* height of a torus *)

SetOptions[ParametricPlot3D, PlotRange -> Full, Mesh -> None,

Boxed -> False, Axes -> None, PlotPoints -> 400, ImageSize -> 2600,

Background -> RGBColor[{220, 250, 200}/255],

PlotStyle -> Directive[Specularity[White, 30], Texture[Import["D:/tmp/60.jpg"]]],

TextureCoordinateFunction -> ({#4, #5 + 2 Pi/b1} &), Lighting -> "Neutral"];

 

f[v_] := TriangleWave[{-1, 1}, v/(2 Pi)];

g[v_] := TriangleWave[{-1, 1}, v/(2 Pi) + 1/4];

x = (a - h1 g[t] + h2 f[b1 s]) Cos[b3 (s + 3 Pi/(4 b1))];

y = (a - h1 g[t] + h2 f[b1 s]) Sin[b3 (s + 3 Pi/(4 b1))];

z = a - h3 (g[t] + f[b2 t]) + c;

rm = Table[{x, y, z}.RotationMatrix[2 i Pi/d, {1, 1, 0}], {i, d}];

 

ParametricPlot3D[rm, {t, 0, 2 Pi}, {s, 0, 2 Pi}]

 

(*---

The Texture

Another shapes and colors

*)

 

718 views
1 fave
1 comment
Uploaded on June 28, 2012