Complex Inversion

2006-08
   Xah
   xah@xahlee.org
 ∑ http://xahlee.org/

Clear[ WindowPolygon];
WindowPolygon::"usage" = "WindowPolygon[p_Polygon, s] will cut \
a Polygon p open by the scale of 0<s<1. WindowPolygon[gra,s] will cut every \
Polygon in gra. Usage Example: \
Needs[\"Graphics`Shapes`\"];Show[Graphics3D[WindowPolygon[Sphere[1,10,8],.7]]]\
";
\(\(WindowPolygon[\ poly_Polygon\ , scale_] := \ 
        Module[{centerP, pts1, pts2}, 
		pts1 = First@\ poly; 
          centerP = \((Plus @@ pts1)\)/
              Length@pts1; 
		pts2 = \(\((\((# - centerP)\) scale + 
                    centerP)\)\  &\) /@ \ pts1; 
          Polygon /@ \ 
            Thread[{pts1, RotateLeft[pts1], RotateLeft[pts2], 
                pts2}]];\)\)
WindowPolygon[ g_, scale_] := 
        g /. l_Polygon :> WindowPolygon[l, scale];

Needs["Transform2DPlot`"]

preimage = 
      Show[(WindowPolygon[#,  .7] &)@(IncreaseGraphicsResolution[#, 
                  3] &)@
            RectangularPatchGraphics[{-2, 2, 12,  .1},  {-2, 2, 
                12,  .1}], Frame -> True, 
        AspectRatio -> Automatic, PlotRange -> All, 
        Background -> GrayLevel[0]]
postimage = 
      Transform2DGraphicsPlot[preimage, (1/(#1 + #2*I) &), 
        ResolutionLength ->  .1, AspectRatio -> Automatic, 
        Background -> GrayLevel[0], Frame -> True]

rs = StereographicProjectionPlot3D[postimage]

preimage = 
      Show[PolarPatchGraphics[{ .5, 1.5, 6,  .2},  {0, 6, 10,  .1},  .05], 
        Frame -> True, AspectRatio -> Automatic, 
        PlotRange -> All]
postimage = 
      Transform2DGraphicsPlot[preimage, (1/(#1 + #2*I) &), 
        ResolutionLength -> Infinity, AspectRatio -> Automatic, 
        Frame -> True]

rs = StereographicProjectionPlot[postimage]

JavaView

Export graphics to file for JavaView

eP = 3;
tt = OpenWrite["x.mgs"];
WriteString[tt, "Graphics3D["];
\(\(WriteString[
        tt, \((StringReplace[#, ", " -> ","] &)\)@\(ToString@
            NumberForm[
              SetPrecision[Chop[First@rs, 10^\(-\((eP + 1)\)\)], eP], 
              ExponentFunction -> \((If[\(-∞\) < #1 < ∞, Null, #1] &)\)]\)];\)\)
WriteString[
        tt, ",Lighting->False]"];
Close@tt;