MathGroup Archive 2000

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

Search the Archive

Re: tracing lines on surface-graphics

  • To: mathgroup at
  • Subject: [mg25596] Re: tracing lines on surface-graphics
  • From: Jens-Peer Kuska <kuska at>
  • Date: Wed, 11 Oct 2000 03:50:37 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <8rtst2$>
  • Sender: owner-wri-mathgroup at


form Plot3D[] you get a SurfaceGraphics[] object. The first argument
of SurfaceGraphics[] are the f[x[i],y[i]] on a regular matrix. 
To get the sparse meshlines you can  take the rows or columns
of this matrix, extend it whith the x and y values where the line is
and add this line to a graphics object that is displayed whith the

Make a surface:

gr = Plot3D[Sin[x^2 + y^2]/(1 + x^2 + y^2), {x, -Pi, Pi}, {y, -Pi, Pi}, 
    PlotPoints -> 60, Mesh -> False, DisplayFunction -> Identity]

compute a line :

{nx, ny} = Dimensions[gr[[1]]];
xymesh = MeshRange /. gr[[2]];
{{x1, x2}, {y1, y2}} = xymesh;
dx = (x2 - x1)/(nx - 1);
dy = (y2 - y1)/(ny - 1);
l1 = MapIndexed[{x1 + (First[#2] - 1)*dx, y1 + 30*dy, #} &, gr[[1,

combine the two graphics:

Show[Graphics3D[Line[l1]], gr]

Alan Wetherby wrote:
> Hi - I can't find an obvious way to trace a line on a surface-graphics
> object. I've plotted f(x,y) and got the surface I want, and now I want
> to add a curve, say: x varies according to the plotted range, y=1+x/2,
> z=f(x,y) --so it lies on the surface I've plotted. I've turned the mesh
> off because it's too dense, given the number of points I'm plotting,
> but I want to add a couple of such lines - another option would be to
> trace every 20th mesh-line or something like that, but that doesn't
> seem to be possible either.
> Thanks for any help -- Alan
> Sent via
> Before you buy.

  • Prev by Date: RE: Mapping down two lists
  • Next by Date: Re: Harmonic Analysis (Harmonic Matching) (Symbolic) in Mathematica
  • Previous by thread: Re: tracing lines on surface-graphics
  • Next by thread: Re: tracing lines on surface-graphics