[Date Index]
[Thread Index]
[Author Index]
RE: Avoid meshing
*To*: mathgroup at smc.vnet.net
*Subject*: [mg18119] RE: [mg17352] Avoid meshing
*From*: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
*Date*: Thu, 17 Jun 1999 12:26:47 -0400
*Delivery-date*: Thu Jun 17 14:49:57 1999
*Sender*: owner-wri-mathgroup at wolfram.com
Alexander Kricke wrote:
------------------------
How can I prevent that Mathematica 3.0 generates a mesh for following
object
ParametricPlot3D[{r*Cos[phi],r*Sin[phi],0,RGBColor[1,0,0]},
{phi,0,Pi/2},{r,0,1},Lighting->False];
Mesh->False does not work.
---------------------
The code in the next line will do what you want.
In[1]:=
ParametricPlot3D[{r*Cos[phi],r*Sin[phi],0,
{EdgeForm[],RGBColor[1,0,0]}},
{phi,0,Pi/2},{r,0,1},Lighting->False
];
----------------------
Your question made me discover a big can of worms. To see what I mean read
on. First read the usage message for Mesh.
In[2]:= ?Mesh
Mesh is an option for SurfaceGraphics and DensityGraphics that specifies
whether an explicit x-y mesh should be drawn.
The usage message doesn't say so but Mesh is also an option for DensityPlot,
ListDensityPlot, ListPlot3D, and Plot3D. I suppose these functions use the
Mesh option because they make DensityGraphics or SurfaceGraphics.
No other functions recognize the Mesh option.
------------
When you use
ParametricPlot3D[{fx, fy, fz, s}, {x,xmin,xmax},{y,ymin,ymax}]
(s) can be a single graphics directive or a list of graphics directives. Now
consider the EdgeForm directive below.
In[3]:= ?EdgeForm
EdgeForm[g] is a three-dimensional graphics directive which specifies that
edges of polygons are to be drawn using the graphics directive or list of
graphics directives g.
EdgeForm[] indicates no edges should be drawn.
In the usage message above "three-dimensional graphics directive" reefers to
directives used with Graphics3D. Plot3D makes SurfaceGraphics (not
Graphics3D) so EdgeForm can't be used inside Plot3D. Of course Plot3D has
the Mesh option and that takes care of our needs in many cases.
Notice EdgeForm is much more versatile than the Mesh option. Consider the
next line where the shade of the polygon edges is a function of (r).
In[4]:=
ParametricPlot3D[{r*Cos[phi],r*Sin[phi],0,
{EdgeForm[GrayLevel[r]],RGBColor[1,0,0]}},
{phi,0,Pi/2},{r,0,1},Lighting->False
];
--------------
In the next line two graphic directives are used inside EdgeForm. In this
case
EdgeForm[{d1,d2}] must be used.
In[5]:=
ParametricPlot3D[{r*Cos[phi],r*Sin[phi],0,
{EdgeForm[{GrayLevel[r-2],AbsoluteThickness[3]}],RGBColor[(4-r)/2,0,0]}},
{phi,0,Pi/8},{r,2,3},Lighting->False,PlotPoints->6
];
--------------------
The usage message for EdgeForm suggests it can be used with Graphics3D
expressions. This can be demonstrated with one of the standard packages.
In[6]:=
<<Graphics`Shapes`
The next two lines respectively make a torus with no edges and then with
gray edges.
In[7]:=
Show[Graphics3D[{EdgeForm[], Torus[ ] }]];
In[8]:=
Show[Graphics3D[{EdgeForm[GrayLevel[0.6]], Torus[ ] }]];
--------------------
I found it's a little difficult to get a gray mesh using Plot3D.
I was able to do it with the code below.
In[9]:=
Block[{$DisplayFunction=Identity},
gr=Plot3D[Sin[x y],{x,0,3},{y,0,3}]];
Show[Graphics3D[{EdgeForm[GrayLevel[0.6]],Part[Graphics3D[gr],1]}],
Axes->True,BoxRatios->{1,1,0.4}];
--------------------
Now how do you make a DensityPlot with a gray mesh?
That's also tricky. I haven't bothered to work it out, but you could use
Block[{$DisplayFunction=Identity},
densty=DensityPlot[f,{x,xmin,xmax},{y,ymin,ymax},Mesh->False]]
Then use the parts of (densty) to make a gray mesh made of 2D primitives and
directives, and display the two using
Show[densty, GrayMesh]
---------------------
Regards,
Ted Ersek
Prev by Date:
**Options for a function**
Next by Date:
**Reading in equations for evaluation**
Previous by thread:
**Re: Options for a function**
Next by thread:
**Re: RE: Avoid meshing**
| |