Question: Using complex color procedures with plot3d

The creation of 2D color plots is not very comprehensively supported by Maple. However, such plots may be produced by using plot3d with its 'color' option. Unfortunately, plot3d(..., color=myProc(x,y)) works only under certain conditions.  The problem seems to be that myProc(x,y) is evaluated by plot3d just one time. Thereby, unassigned variables 'x' and 'y' are given over instead of numeric values. The returned expression is then used for numerous calculations of the color by successively assigning different values to 'x' and 'y'. This method does, however, not work if myProc(x,y) needs some concrete numerical values in order to work properly. The documentation for plot3d/color gives an example with 'color=proc(x,y) x*y end proc'. But what is the difference to the specification of an expression 'color=x*y' when it is not possible to use color=myProc(x,y) without the limitations described above?

Is the reported problem a bug of Maple 11.02? Are there any possibilities to use a separate procedure myProc(x,y) which does more then just returning expressions like x*y?

> f := (x,y) -> 4*(sin(x/2)+sin(y/4))+3*sin(x/2):
> myProc:=proc(a,b)
   if a*b>100 then 100 else a*b end if;
  end proc:
> plot3d(f, 0..20, 0..70, style=patch, color=myProc(x,y));
Error, (in myProc) cannot determine if this expression is true or false: 100 < x*y
> plot3d(f, 0..20, 0..70, style=patch, color=proc(x,y) if x*y>100 then 100 else x*y end if; end proc);
 

Please Wait...