MathGroup Archive 2006

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

Search the Archive

Re: 3D surface plotting

  • To: mathgroup at
  • Subject: [mg66310] Re: 3D surface plotting
  • From: "Borut Levart" <BoLe79 at>
  • Date: Tue, 9 May 2006 02:34:59 -0400 (EDT)
  • References: <e3mjjm$7lf$>
  • Sender: owner-wri-mathgroup at


My function of choice would probably be ListSurfacePlot3D too, but
"mine" doesn't reside in ExtendGraphics`, but in: Graphics`Graphics3D`.

When a function returns the input data (headed with the function), the
cause can easily lie in a wrong input form. Here is my solution:

First I define a function p2 that generates n random points on a unit

p2[n_] :=
        pts = Table[{2 Pi Random[], ArcCos[2 Random[] - 1]}, {n}]
      pts /. {f_, t_} -> {Sin[t] Cos[f], Sin[t] Sin[f], Cos[t]}];

This produces a plot of n = 1000 points:

  Boxed -> False,
  Axes -> False]

Now to stretch a surface over these points, one cannot just call
ListSurfacePlot3D, because the input must be in a form of: an array of
3D points that generate vertices in a polygonal mesh. So one must
partition the points: in threes for triangles; in fours for
quadrangles, etc.
Let's try this:

ListSurfacePlot3D[Partition[p2[20], 3]]

This produces some odd overlapping triangles, since the generated
points are random and thus not sorted "polygon-wise." One must sort
them first. But how?
Yes, how. There is an example of sorted sphere points in the Help
Browser under Graphics3D Standard Package (but they are not random).
I don't know anything about the nature of you points. Sort them
polygon-wise, partition this n-couples together, and call the function.

I hope this helps in any way; does it?

Borut Levart

  • Prev by Date: Re: Mathematica Language Encoding in Linux?
  • Next by Date: Re: creating a symbolic square symmetric matrix
  • Previous by thread: Re: 3D surface plotting
  • Next by thread: Re: 3D surface plotting