Consider the following example data which creates the lines of a cylinder
data=Table[{Cos[phi],Sin[phi],z},{phi,0,2Pi,.1},{z,0,1,.1}];
Graphics3D[{RandomChoice[ColorData[3,"ColorList"]],Line[#]}&/@data]
The coloring indicates the structure of data
which is a list of lines where with lines I mean a list of {x,y,z}
coordinates. Therefore, data
is of dimension {63, 11, 3}
: 63 lines where each line as 11 points.
With the legacy package of older Mathematica versions it was now possible to create the surface of the cylinder by
Needs ["Graphics` Graphics3D `"]
ListSurfacePlot3D[data]
If you look on the usage of the built-in ListSurfacePlot3D
function you see that it can only take a list of 3D points and not such a structured tensor as data
. When you then try it anyway, you get a surprising result:
ListSurfacePlot3D[data]
Question: is it possible to create the surface of the cylinder like the old version of ListSurfacePlot3D
did?
On this simple examples, a call to
ListSurfacePlot3D[Flatten[data, 1]]
helps. Unfortunately, for my original data here, this doesn't work. You can recreate the error by shearing the cylinder data
data = Table[
{Cos[phi] + 2 z, z, Sin[phi] + z}, {phi, 0, 2 Pi, .1}, {z, -2,
2, .1}];
Graphics3D[{RandomChoice[ColorData[3, "ColorList"]], Line[#]} & /@
data]
ListSurfacePlot3D[Flatten[data, 1]]
and then you get