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

combining surface graphics objects

Skip to first unread message

Johannes Ludsteck

May 11, 2002, 4:11:35 AM5/11/02
Dear Mathgroup members,
I would like to combine two 'transparent' function plots.
Mathematica renders 'transparent' plots when the
option HiddenSurface->False is given, for example:

p1= Plot3D[x+y,

Now I want to combine it with a second plot:

p2= Plot3D[Sin[8 x y],

However, when I request


Mathematica has lost the HiddenSurface option and
plots both surfaces filled. And even
worse, it does not accept the option in Show.


I tried some other solutions, for example using
SurfaceGraphics explicitly:


However, none of the were successful.

A more heroic goal would be to combine a transparent
with an non-transparent plot.

Any suggestions?

Thank you very much in advance,
Johannes Ludsteck

Johannes Ludsteck
Institut fuer Volkswirtschaftslehre
Lehrstuhl Prof. Dr. Moeller
Universitaet Regensburg
Universitaetsstrasse 31
93053 Regensburg
Tel +49/0941/943-2741

David Park

May 12, 2002, 3:31:46 AM5/12/02

I am always learning something from MathGroup questions! I never understood
before what "HiddenSurface" meant. Apparantly, HiddenSurface -> False means
the same as wire frame. I guess that is what your mean by a "transparant

Having learned that, it is easy to do what you want with my DrawGraphics
package, available at my web site. Here one surface is drawn as a wire frame
and the second surface normally.


{Draw3D[x + y, {x, 0, 1}, {y, 0, 1}] // UseWireFrame,
Draw3D[Sin[8 x y], {x, 0, 1}, {y, 0, 1}]},
BoxRatios -> {1, 1, 1/2},
Axes -> True,
ImageSize -> 400];

Draw3D is just like Plot3D except that it extracts the graphics object and
converts it to Graphics3D, without making a side plot. UseWireFrame applies
the WireFrame routine from the Shapes package to the graphics primitives.
One of the main purposes of DrawGraphics is to make it easy to manipulate
and combine graphical objects produced by various plot types.

David Park

Allan Hayes

May 12, 2002, 3:39:50 AM5/12/02
"Johannes Ludsteck" <> wrote in
message news:abijnn$le2$

You need to use the function WireFraim from the package Graphics`Shapes` or
to do a little programming:

I begin with your first two inputs, notice that the ourtput is a
SurfaceGraphics object

p1 = Plot3D[x + y, {x, 0, 1}, {y, 0, 1}, HiddenSurface -> False]


p2 = Plot3D[Sin[8*x*y], {x, 0, 1}, {y, 0, 1}, HiddenSurface -> False]

Below we combine these outputs into a single object, here it is a Graphics3D
object because SurfaceGraphics stores the description as a table of heights
which is not possible with possibly overlapping and intersecting
surfaces --- Graphics3D stores the description as a list of polygon
objects,(wecan see this if you evaluted InputForm[p1] etc.) moreover the
HiddenSurface option is deleted - it is not effective.

p12 = Show[p1, p2]


Now, load the package.

<< "Graphics`Shapes`"

WireFrame replaces each object Polygon[{pt1, pt2, pt3, pt4}] with Line[pt1,
pt2, pt3, pt4, pt1}]


It is unnecessary to use HiddenSurface -> False if all that you want is the
last picture.

Below, I do little replacement instead of using WireFrame; I also turn off
the display for unwanted constructin images and turn it back on again for
the final image.

Plot3D[#, {x, 0, 1}, {y, 0, 1}, DisplayFunction -> Identity] & /@ {x +
y, Sin[8*x*y]}] /.
Polygon[pts_] :> Line[Append[pts, First[pts]]],
DisplayFunction -> $DisplayFunction]


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

0 new messages