I would like to draw a Calabi-Yau space in Mathematica. From Andrew J. Hanson's paper (page 6) about this topic, I got the following code, which just does not show anything at all in my Mathematica test version. I am a newbie coming from the processing/open frameworks direction. Any help would be highly appreciated - Thank you!
cCos[theta_, xi_] := .5 (Eˆ (xi + I theta) + Eˆ (-xi - I theta));
cSin[theta_, xi_] := (-.5 I) (Eˆ (xi + I theta) - Eˆ (-xi - I theta));
z1[theta_, xi_, n_, k_] := Eˆ (k*2*Pi*I/n)*cCos[theta, xi] ˆ (2.0/n);
z2[theta_, xi_, n_, k_] := Eˆ (k*2*Pi*I/n)*cSin[theta, xi] ˆ (2.0/n);
pz1[theta_, xi_, n_, k_] := Eˆ ((xi + I theta)/n)*Eˆ (k*2*Pi*I/n);
pz2[theta_, xi_, n_, k_] := Eˆ ((-xi - I theta)/n)*Eˆ (-k*2*Pi*I/n);
MakePolygons[vl_List] :=
Block[{l = vl, l1 = Map[RotateLeft, vl], mesh},
mesh = {l, l1, RotateLeft[l1], RotateLeft[l]};
mesh = Map[Drop[#, -1] &, mesh, {1}];
mesh = Map[Drop[#, -1] &, mesh, {2}];
Polygon /@ Transpose[Map[Flatten[#, 1] &, mesh]]]
n1 = 3; n2 = 3; xiSteps = 17; xiMax = 1; thetaSteps = 17; angle = Pi/4;
cosA = Cos[angle]; sinA = Sin[angle];
Do[Do[patch33[k1 + 1, k2 + 1] =
MakePolygons[
Table[Block[{z1Val = N[z1[theta, xi, n1, k1]],
z2Val = N[z2[theta, xi, n2, k2]]}, {Re[z1Val], Re[z2Val],
cosA*Im[z1Val] + sinA*Im[z2Val]}], {xi, -xiMax,
xiMax, (2*xiMax)/(xiSteps - 1)}, {theta, 0,
Pi/2, (Pi/2)/(thetaSteps - 1)}]], {k1, 0, n1 - 1}], {k2, 0,
n2 - 1}];
zi -> pzi and Pi/2 -> 2 Pi;
bs0 = 0.8; bs1 = 0.2; lt = 0.9;
surface33 =
Show[Graphics3D[
Table[[Block[{bs =
If[And[k1 == 0, k2 == 0], bs0, bs1]}, {RGBColor[
bs + lt*k1/(n1 - 1), bs + lt*k2/(n2 - 1), bs],
patch33[k1 + 1, k2 + 1]}] {k1, 0, n1 - 1}, {k2, 0, n2 - 1}],
Lighting -> False, Axes -> None, Boxed -> False,
BoxRatios -> {1, 1, 1}, ViewPoint -> {2.9, 1.0, 1.4}]]];