Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mesh on graphics3D objects

178 views
Skip to first unread message

Scott Morrison

unread,
Oct 13, 1998, 3:00:00 AM10/13/98
to
I am trying to plot a complicated surface in Mathematica, using
ParametricPlot3D or SurfaceListPlot3D (from Graphics`Graphics3D`).
These both produce Graphics3D objects.
I am trying to remove the mesh drawn over the surface (for Plot3D this
is easily acheived with Mesh->False). Does anyone know how to do this?
I can't work out anything!

Thanks, Scott Morrison
sc...@morrison.fl.net.au

Allan Hayes

unread,
Oct 15, 1998, 3:00:00 AM10/15/98
to

Scott Morrison wrote in message <6vurcc$8...@smc.vnet.net>...

Scott:

For ParametricPlot3D:

ParametricPlot3D[{x,y,x^2+y^2, EdgeForm[]}, {x,0,1},{y,0,1}];

For ListSurfacePlot3D:

<<Graphics`Graphics3D`

apts = Table[{Cos[t] Cos[u], Sin[t] Cos[u],
Sin[u]}, {t, 0, Pi, Pi/5},
{u, 0, Pi/2, Pi/10}];

lsp=ListSurfacePlot3D[apts];

Show[lsp/.p:{___Polygon}->{EdgeForm[],p}]

The latter works for any Graphics3D object (except that we have to use

Show[lsp/.p:_Polygon}->{EdgeForm[],p}]

if the polygons are not in a list)

Allan
----------------------
Allan Hayes
Mathematica Training and Consulting
www.haystack.demon.co.uk
h...@haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565


Ersek, Ted R

unread,
Oct 15, 1998, 3:00:00 AM10/15/98
to

Scott Morrison (sc...@morrison.fl.net.au) wrote:
>
>
>I am trying to plot a complicated surface in Mathematica, using
>ParametricPlot3D or SurfaceListPlot3D (from Graphics`Graphics3D`).
>These both produce Graphics3D objects.
>I am trying to remove the mesh drawn over the surface (for Plot3D this
>is easily acheived with Mesh->False). Does anyone know how to do this?
>I can't work out anything!
>
>

Allan Hayes posted the following to the Mathgroup on 5/25/98 in
[mg12588] Re: About plotting a surface.

ParametricPlot3D[{x,y,Sin[x+ Sin[y]], EdgeForm[]},{x,0,6},{y,0,6}]

_____________________

Allan Hayes also posted the following to the Mathgroup on 5/30/98 in
[mg12655] Re: About plotting a surface.

NoMesh2[Graphics3D[c_,rest___]]:=
Graphics3D[{EdgeForm[],c/._EdgeForm :>Sequence[]},rest]

The code above is a more robust (and a bit more complicated) than a
version Roman-Meader gave in
The Mathematica Journal 2(3), 32. This version is more robust because
it will get rid of any EdgeForm directives that may be present.

___________________

P.J. Hinton posted the next solution to the Mathgroup on 5-25-98 in
[mg12570]Re: About plotting a surface.

The graphics generated by Plot3D[] are represented by Mathematica as
SurfaceGraphics objects, for which Mesh is a valid option. Surfaces
generated by ParametricPlot3D[] are represented internally with more
general Graphics3D objects, which do not support a Mesh option. The
elimination of lines can be achieved through the EdgeForm[] directive,
which is used to modify the Polygon[] primitives in the Graphics3D
object.

Here is an example using a ParametricPlot3D[]-generated sphere

<<Graphics`ParametricPlot3D`

gr = (ParametricPlot3D[
{Cos[u] Cos[v], Sin[u] Cos[v], Sin[v]},
{u, 0, 2Pi, Pi/20},
{v, -Pi/2, Pi/2, Pi/10}, DisplayFunction -> Identity] /.
Polygon[x_] -> {EdgeForm[], Polygon[x]} )

Show[gr, DisplayFunction -> $DisplayFunction]

The operation above uses ReplaceAll[] (/.) to place all Polygon[]
primitives inside of lists which contain a null argument EdgeForm[]
directive.

See Section 2.9.9 of _the Mathematica Book_ for details.

You can also paste the following ButtonBox[] in a Mathematica notebook
to create a hyperlink that will point you to the relevant section.

\!\(\*
TagBox[
ButtonBox[\(Using\ the\ EdgeForm\ directive\),
ButtonData:>{"2.9.9", "9.14"},
ButtonStyle->"MainBookLink"],
DisplayForm]\)
___________________________

Cheers,
Ted Ersek


Jurgen Tischer

unread,
Oct 15, 1998, 3:00:00 AM10/15/98
to
Hi Scott,
have a look if this is what you want.

In[1]:=
gr=ParametricPlot3D[{Cos[s]Sin[t],Sin[s]Sin[t],Cos[t]},{s,0,2Pi},{t,0,
Pi},DisplayFunction->Identity]

In[2]:=
Show[Graphics3D[{EdgeForm[],gr[[1]]},gr[[2]]]]

Jurgen

Scott Morrison wrote:
>
> I am trying to plot a complicated surface in Mathematica, using
> ParametricPlot3D or SurfaceListPlot3D (from Graphics`Graphics3D`).
> These both produce Graphics3D objects.
> I am trying to remove the mesh drawn over the surface (for Plot3D this
> is easily acheived with Mesh->False). Does anyone know how to do this?
> I can't work out anything!
>

> Thanks, Scott Morrison
> sc...@morrison.fl.net.au

Hans Staugaard

unread,
Oct 15, 1998, 3:00:00 AM10/15/98
to
Here are three ways:
Here I use a torus as an example

(1) p1=ParametricPlot3D[
{Cos[t](3+Cos[f]),Sin[t](3+Cos[f]),Sin[f]},
{t,0,2Pi},{f,0,2Pi}]

Show[Graphics3D[{EdgeForm[],p1[[1]]}]]

(2) ParametricPlot3D[
{Cos[t](3+Cos[f]),Sin[t](3+Cos[f]),Sin[f],EdgeForm[]},
{t,0,2Pi},{f,0,2Pi}]

And if i want to use my own colorfunction i can use method (1), or i can
use

(3) ParametricPlot3D[
{Cos[t](3+Cos[f]),Sin[t](3+Cos[f]),Sin[f],{EdgeForm[],colorfun}},
{t,0,2Pi},{f,0,2Pi},Lighting->False]

Hans

Alejandro Osorio

unread,
Oct 18, 1998, 3:00:00 AM10/18/98
to
Hi Scott

You can do this by preppending the directive "EdgeForm" to the list of
primitives in the Graphics3D object, like the following example:

a) generate some graphics:

f[u_,v_]:={u,v,u^3-3u v^2};
graf=ParametricPlot3D[f[u,v]//Evaluate,{u,-1,1},{v,-1,1},BoxRatios->{1,1,1}]
;

then graf[[1]] is the list of primitives ("Polygon"s) and graf[[2]] the
lisrt of options.

b) now rebuild the first part and use "Show":

Show[Graphics3D[{EdgeForm[],graf[[1]]}],graf[[2]]]

and it's done.

Is there a simpler way to do the same ?

-----Mensaje original-----
De: Scott Morrison <sc...@morrison.fl.net.au> Para:
math...@smc.vnet.net <math...@smc.vnet.net> Fecha: Lunes 12 de
Octubre de 1998 5:16 PM Asunto: [mg14327] Mesh on graphics3D objects

0 new messages