5.9 3d plots with patch (10.5.00)

5.9.1 Sandy Yates
5.9.2 Robert Israel (11.5.00)
5.9.3 John S Robinson (12.5.00)
5.9.4 Jurgen Barsuhn (15.5.00)

5.9.1 Sandy Yates

I am plotting a function where I need an 100x100 grid for the 3D plot to look reasonable. My problem is that I would like the see the plot with PATCH.

When I plot it with PATCH the patching is so dense that the ZHUE cannot be seen as the plt is very black. Is it possible to plot every second or 3rd PATCH line? Or is there another method to getting a lower PATCH grid compared the to plot grid? (I realize why maple may not want to do that as the line of te patch may cut the surface.)

5.9.2 Robert Israel (11.5.00)

My suggestion would be to combine (using display) a plot using patchnogrid and plots of grid lines. It would be simplest to do the latter using spacecurve, but if you want, you can extract them from the plot structure, e.g. as follows:

  p1:= plot3d(f(x,y), x=a..b, y=c..d, grid=[100,100], style=patchnogrid): 
  A:= op([1,3],p1): # this should be the hfarray of z values 
  dx:= (b-a)/99: dy:= (d-c)/99: 
  lines:= seq([seq([a+(i-1)*dx, c+3*(j-1)*dy, A[i,3*j-2]], i=1..100)], 
              j=1..34), 
          seq([seq([a+3*(i-1)*dx, c+(j-1)*dy, A[3*i-2,j]], j=1..100)], 
              i=1..34): 
  plots[display]({p1, PLOT3D(CURVES(lines),COLOR(RGB,0,0,0))});
 

5.9.3 John S Robinson (12.5.00)

If I understand correctly, you can get round the problem by combining two plots, as in:

 p1:=plot3d((x*y)+2*x+3+y,x=-1..2,y=-2..1,grid=[100,100]): 
 display(p1);
 

this is all black

p2:=plot3d((x*y)+2*x+3+y,x=-1..2,y=-2..1,grid=[100,100],style=PATCHNOGRID): 
display(p2); 
 
p3:=plot3d((x*y)+2*x+3+y,x=-1..2,y=-2..1,grid=[10,10],style=WIREFRAME,colour=BLACK): 
display(p3); 
display({p2,p3});
 

this seems OK

5.9.4 Jurgen Barsuhn (15.5.00)

As far as I know there is no possibility to omit selected grid lines. However, you may omit all grid lines by choosing patchnogrid from the style menu (or by including the option style=patchnogrid into the plot3d-statement).

To improve the impression you may include contour lines that may be seen under style-patch and contour. Here you can either choose the number of contour lines or you may specify a list of function values, for which you wish to see contour lines.

An example of a summit and two saddles:

f:=16-2*x^2-4*y^2+x^2*y; 
plot3d(f,x=-5..5,y=-4..4,view=-16..16,grid=[50,50],shading=ZHUE, 
       style=patchnogrid); 
plot3d(f,x=-5..5,y=-4..4,view=-16..16,grid=[50,50],shading=ZHUE, 
       style=patchcontour,contours=6); 
plot3d(f,x=-5..5,y=-4..4,view=-16..16,grid=[50,50],shading=ZHUE, 
       style=patchcontour,contours=[-2,0,2]);