MathGroup Archive 2000

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

Search the Archive

Re: tracing lines on surface-graphics

  • To: mathgroup at
  • Subject: [mg25603] Re: tracing lines on surface-graphics
  • From: "Allan Hayes" <hay at>
  • Date: Wed, 11 Oct 2000 03:50:41 -0400 (EDT)
  • References: <8rtst2$>
  • Sender: owner-wri-mathgroup at

"Alan Wetherby" <roommate222 at> wrote in message
news:8rtst2$dpo at
> 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.

f[x_, y_] := x^2 + y^3

sg = Plot3D[f[x, y], {x, -1, 1}, {y, -1, 1}, PlotPoints -> 6];

ln = ParametricPlot3D[{x, x/2, f[x, x/2], {Thickness[.01], Hue[0]}}, {x, -1,

Show[sg, ln]

We have to lift the line a little to stop parts of it being hidden by the

ln2 = ln =
    ParametricPlot3D[{x, x/2,
        f[x, x/2] + .1, {Thickness[.01], Hue[0]}}, {x, -1, 1}]

Show[sg, ln2];

For surfaces given by ParametricPlot3D we have to be more subtle. Two
possibilities are: 1) pulling the line towards the view point and 2)
approximating it by line segments across the triangles that, in spite of
appearence, make up the displayed polygons.

Controlling the number of mesh lines shown is the objective of a package by
Hartmut Wolf and myself that will appear in the next issue of Mathematica in
Education and Research.

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

  • Prev by Date: RE: tracing lines on surface-graphics
  • Next by Date: RE: Mapping down two lists
  • Previous by thread: RE: tracing lines on surface-graphics
  • Next by thread: Re: tracing lines on surface-graphics