Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to convert a flat scan of a 3D object, into a 3D picture in cylindrical coordinates?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47659] Re: How to convert a flat scan of a 3D object, into a 3D picture in cylindrical coordinates?
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 21 Apr 2004 05:22:57 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <c62jc9$rcf$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,


I can't look at your Exel sheet on my SGI but

mat = Import["Abe3D.txt", "Table"];
{n, m} = Dimensions[mat];
toCylinder[{i_, j_}, r_] := Module[{phi}, phi = 2Pi*(j - 1)/(m - 1);
        {r*Cos[phi], r*Sin[phi], 70(n - i)/n}
    ]

toPolygons[pnts_] := Module[{l = pnts, l1 = Map[RotateLeft, pnts],
mesh},
    mesh = {l, l1, RotateLeft[l1], RotateLeft[l]};
    mesh = Map[Drop[#, -1] &, mesh, {1}];
    mesh = Map[Drop[#, -1] &, mesh, {2}];
    mesh = Map[
          Polygon[Reverse[#]] &,
          Transpose[
            Flatten[#, 1] & /@
              mesh
            ]
          ] // Flatten
    ]

mesh = MapIndexed[toCylinder[#2, #1] &, mat, {2}];
Show[Graphics3D[toPolygons[mesh], ViewPoint -> {-2.618, -1.871, 1.046}]]

Should produce your 3d Lincolm data.

You can use MathGL3d or the RealTime Graphics package to rotate it
in Mathematica.

Regards
  Jens


Gilmar Rodr?guez Pierluissi wrote:
> 
> Please; double-click the following internet links:
> 
> http://www.tilmarlily.netfirms.com/download/Abe3D.txt
> http://www.tilmarlily.netfirms.com/download/Abe3D.xls
> 
> to download:
> 
> (1.) the text file: "Abe3D.txt" and,
> (2.) an Excel spreadsheet: "Abe3D.xls".
> 
> The file "Abe3D.txt" is data obtained by scanning the surface of a
> bust of Abraham Lincoln.  This file contains a 95 X 73 array of
> values.  Each line of longitude was smoothened using a cubic spline,
> and the whole array can be used to draw a (rough) 3D picture of the
> bust.
> You can view this picture by opening the spreadsheet Abe3D.xls,
> and opening the Excel chart in it.  Notice that the image of "Abe"
> (for short)
> is flat; i.e. similar to a Mercator map of the World.  My question is:
> How can I build a 3D picture of Abe, using cylindrical coordinates,
> so that the new picture looks like the real bust of Abe, and a person
> can rotate the picture of the bust in 3D?
> Thank you for your help!


  • Prev by Date: Re: How to convert a flat scan of a 3D object, into a 3D picture in cylindrical coordinates?
  • Next by Date: Undo and Plot3D
  • Previous by thread: Re: How to convert a flat scan of a 3D object, into a 3D picture in cylindrical coordinates?
  • Next by thread: another bug...