Re: 3D-Surface-Plot:Help!

*To*: mathgroup at christensen.cybernetics.net*To*: mathgroup at christensen.cybernetics.net*Subject*: [mg1680] Re: [mg1655] 3D-Surface-Plot:Help!*From*: twj (Tom Wickham-Jones)*Date*: Mon, 17 Jul 1995 00:14:15 -0400

Hannes Hochmeister writes >We have to plot the surface of a landfill or a certain landscape in a >3D-Surface-Plot. >Also we need a ContourPlot in 3D of this surface. >In Mathematica Journal, Vol. 4 Issue 2 and 4 are two articles which give a >solution for the problem, but only when the data are values of a function or >of a regularely matrix. >But we have only unregular data (coordinates in x, y, z). In this case >Mathematica can not find and plot the z-ordinate to the values of x and y. > >If you have a solution for this problem, please send an e-mail to: There is a collection of packages on MathSource that will plot surfaces and contours over irregular data of the form { p1, p2, ...} where each pi is a triple {x,y,z} of numbers. The MathSource number is 0205-041, the title is ExtendGraphics Packages by Tom Wickham-Jones. It uses a computational geometry approach to triangulate the data and then forms the appropriate elements for a surface or contours from this triangulation. The Interpolate function will not work since it only works for regular data, if you knew the functional form of the data you could use a fitting technique as an alternative. When you say you want a ContourPlot in 3D if you mean you want to draw the contour lines, solutions of f(x,y) == z, and then to plot them in 3D space this can be done by a simple function demonstrated here. It is demonstrated with the ContourPlot command but it will work with the extended ListContourPlot provided in the ExtendGraphics package. Make3DLines[ c_ContourGraphics, fun_, x_, y_] := Module[ {val}, First[ Graphics[ c]] /. Line[ pts_] :> ( val = Apply[ Function[{x,y},fun], First[ pts]] ; Line[ Map[ Append[ #, val]&, pts]]) ] c = ContourPlot[ x y, {x,-2,2},{y,-2,2}, ContourShading -> False] Make3DLines[ c, x y, x, y] ; Show[ Graphics3D[ %]] Tom Wickham-Jones WRI