<font color='black' size='2' face='Arial, Helvetica, sans-serif'>I propose a new command \ psSURFACE to not modify the existing command.<br>
<br>
<font size="2">\documentclass{article}<br>
\usepackage{pst-solides3d}<br>
\makeatletter<br>
\define@key[psset]{pst-solides3d}{translation}{\def\pst@solides@translation{#1 }}<br>
\psset[pst-solides3d]{translation=0 0}<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
%% la macro \psSurface<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
\def\psSURFACE{\def\pst@par{}\pst@object{psSURFACE}}<br>
\def\psSURFACE@i#1{%<br>
  \begin@SpecialObj<br>
  \addto@pscode{<br>
    1 setlinejoin<br>
    /TRANSLATE {\pst@solides@translation} def<br>
    \tx@optionssolides<br>
    SolidesDict begin<br>
    /CX 0 def /CY 0 def /CZ 0 def<br>
    TRANSLATE /tY exch def /tX exch def<br>
    \ifPst@algebraic<br>
      /fonction (#1) tx@AlgToPs begin AlgToPs end cvx def<br>
    \else<br>
      /fonction  { #1 } def<br>
    \fi<br>
    /f {2 dict begin<br>
      /y exch def<br>
      /x exch def<br>
      fonction<br>
       end<br>
    } def<br>
/newSURFACE* {<br>
7 dict begin<br>
   /f_surface exch def<br>
   [[/nx /ny] [6 6] [6 8] [10 8] [16 12] [16 36]] gestionsolidmode<br>
   nx isinteger not {<br>
       %% alors nx est un dx<br>
       /nx xmax xmin sub nx div cvi store<br>
   } if<br>
   ny isinteger not {<br>
       %% alors ny est un dy<br>
       /ny ymax ymin sub ny div cvi store<br>
   } if<br>
   /dy ymax ymin sub ny div def %% le pas sur y<br>
   /dx xmax xmin sub nx div def %% le pas sur x<br>
   %% ny = nb de meridiens<br>
   %% nx = nb d horizontales<br>
   /r exch def<br>
   /F [<br>
       %% 1er etage<br>
       1 1 ny {<br>
           /i exch def<br>
           [0 i i ny mod 1 add]<br>
       } for<br>
       %% etages suivants<br>
       0 1 nx 2 sub {<br>
           /j exch def<br>
           1 1 ny {<br>
               /i exch def<br>
               [i      j ny mul add<br>
               i ny add j ny mul add<br>
               i ny mod ny add 1 add j ny mul add<br>
               i ny mod 1 add j ny mul add]<br>
           } for<br>
      } for<br>
   ] def<br>
   %% tableau des sommets<br>
   /S [<br>
       0 0 0 0 f_surface<br>
       1 1 nx {<br>
           /j exch def<br>
           1 1 ny {<br>
             /i exch def<br>
             /theta i 360 mul ny div def<br>
             theta cos r j mul nx div mul tX add<br>
             theta sin r j mul nx div mul tY add<br>
             2 copy f_surface<br>
          } for<br>
       } for<br>
   ] def<br>
   S F generesolid<br>
end<br>
} def<br>
/pst-surface* {<br>
   r<br>
   ngrid length 2 ge {<br>
      [ngrid 0 get ngrid 1 get]<br>
   } {<br>
      ngrid length 1 eq {<br>
         [ngrid 0 get dup]<br>
      } ifelse<br>
   } ifelse<br>
   {f} newSURFACE*<br>
   solidbiface { dup videsolid } if<br>
   gere_pstricks_opt<br>
} def<br>
    pst-surface*<br>
    end<br>
  }% fin du code ps<br>
    \use@pscode%<br>
    \end@SpecialObj<br>
  \ignorespaces}<br>
\makeatother<br>
\begin{document}<br>
\begin{center}<br>
\begin{pspicture}(-5,-4)(6,15)<br>
\psset{viewpoint=50 10 30 rtp2xyz,Decran=100,lightsrc=viewpoint}<br>
\psSolid[object=grille,base=-2 2 -2 2,action=draw]%<br>
\axesIIID(0,0,0)(2,2,1)<br>
\psSURFACE[<br>
   fillcolor=cyan,<br>
   r=1,<br>
   ngrid=.25 .25,incolor=yellow,grid]{%<br>
   Euler x y mul exp }<br>
\psSurface[<br>
   action=draw,linewidth=0.01,linecolor=gray!70,<br>
   ngrid=.2 .2,incolor=yellow](-1.5,-1.5)(1.5,1.5){%<br>
   Euler x y mul exp }<br>
\psSolid[object=cylindre,r=1,h=2,action=draw,ngrid=1 18,linecolor={[rgb]{0 0.5 0}}]<br>
\psPoint(0,0,1){O}<br>
\psPoint(0,0,3){Z}<br>
\psline{->}(O)(Z)<br>
\uput[r](Z){$z$}<br>
\end{pspicture}<br>
\end{center}<br>
<br>
\begin{center}<br>
\begin{pspicture}(-5,-4)(6,15)<br>
\psset{viewpoint=50 10 30 rtp2xyz,Decran=100,lightsrc=viewpoint}<br>
\axesIIID(0,0,0)(2,2,1)<br>
\psSURFACE[<br>
   inouthue=1 0.5 0.5 1,<br>
   r=1,<br>
   ngrid=.25 .25,incolor=yellow,grid,translation=0.4 0.4]{%<br>
   Euler x y mul exp }<br>
\psSurface[<br>
   action=draw,linewidth=0.01,linecolor=gray!70,<br>
   ngrid=.2 .2](-1.5,-1.5)(1.5,1.5){%<br>
   Euler x y mul exp }<br>
\psSolid[object=cylindre,r=1,h=4,action=draw,ngrid=1 18,linewidth=0.01](0.4,0.4,0)<br>
\psPoint(0,0,1){O}<br>
\psPoint(0,0,5){Z}<br>
\psline{->}(O)(Z)<br>
\uput[r](Z){$z$}<br>
\psPoint(0.4,0.4,0){C}<br>
\psdot(C)<br>
\psSolid[object=grille,base=-2 2 -2 2,action=draw]%<br>
\end{pspicture}<br>
\end{center}<br>
\end{document}<br>
<br>
<br>
</font>
<div class="envelope" style="float: none;" align="left"><img src="cid:AOLP.6647780" id="TIE.6647780" style="margin: 5px; vertical-align: middle;" alt="EXPxy-3.png" class="AOLInlineImage" title="EXPxy-3.png" width="275"></div>

<div>
<div class="envelope" style="float: none;" align="left"><img src="cid:AOLP.6648631" id="TIE.6648631" style="margin: 5px; vertical-align: middle;" alt="EXPxy-4.png" class="AOLInlineImage" title="EXPxy-4.png" width="275"></div>

<div><span><br>
</span></div>
<span></span></div>
<font size="2"><br>
</font>

<div> <br>

</div>



<div> <br>

</div>



<div style="clear:both">Manuel Luque<br>

mluque5130@aol.com<br>

</div>



<div> <br>

</div>



<div> <br>

</div>



<div style="font-family:arial,helvetica;font-size:10pt;color:black">-----E-mail d'origine-----<br>

De : leon.free <leon.free@free.fr><br>

A: Graphics with PSTricks <pstricks@tug.org><br>

Envoyé le : Je, 2 Mar 2017 16:29<br>

Sujet : Re: [pstricks] 3D surface on non rectangular domain<br>

<br>

Thank you Herbert and Manuel,<br>

<br>

I tried both of your solutions.<br>

<br>

Manuel, it seems with your new \psSurface* macro you do not have the usual \psSurface behavior: \psSurface* and \psSurface generate the same figure, whether the r parameter is given or not. For instance, with source the code in your message<br>

<br>

\psSurface*[<br>

   fillcolor=cyan,<br>

%   r=1,<br>

   ngrid=.5 .5,incolor=yellow,grid](-1,-1)(1,1){%<br>

   Euler x y mul exp }<br>

<br>

is the same as with the r=1 line uncommented. Also<br>

<br>

\psSurface[<br>

   fillcolor=cyan,<br>

%   r=1,<br>

   ngrid=.5 .5,incolor=yellow,grid](-1,-1)(1,1){%<br>

   Euler x y mul exp }<br>

<br>

is the same as <br>

<br>

\psSurface[<br>

   fillcolor=cyan,<br>

   r=1,<br>

   ngrid=.5 .5,incolor=yellow,grid](-1,-1)(1,1){%<br>

   Euler x y mul exp }<br>

<br>

This is fine, but the problem is that the \psSurface (unstarred version without passing the r parameter) draws the surface on a circular domain (and I cannot figure out how is this domain controled)<br>

<br>

I then tried Herbert's solution. My objective is to draw a surface of a function f as usual on a rectangular domain (xmin,xmax)X(ymin,ymax), but I also want to draw (on the same figure) the surface of f but only for (x,y) in some spherical domain B (typically a ball with a given radius) using a different color. With Herbert solution, because it translates the origin before drawing the surface for (x,y) \in B, if the surface to be drawn is to coincide exactly with that of f, the function to be plotted after the change of origin (0,0,0) to Neworigin=(ox,oy,0) must be g defined as g(x,y)= f(x+ox,y+oy). Right? If so, here is an example. It seems to me that the surfaces drawn after the change of origin (red and blue) do not exactly overlap with the whole surface of f. Is this the normal behavior? Is there something I do not understand with the change of origin?<br>

elef<br>

<br>

<br>

<br>

----- Mail original -----<br>

De: "Herbert Voss" <Herbert.Voss@FU-Berlin.DE><br>

À: <a href="mailto:pstricks@tug.org">pstricks@tug.org</a><br>

Envoyé: Jeudi 2 Mars 2017 09:11:55<br>

Objet: Re: [pstricks] 3D surface on non rectangular domain<br>

<br>

Am 01.03.2017 um 21:34 schrieb <a href="mailto:leon.free@free.fr">leon.free@free.fr</a>:<br>

> I did not know about the r parameter for \psSurface* (I could not find it in the pst-solides3d doc). It seems it controls the radius of the domain (ball) on which the surface is drawn. Are there some extra parameters that control the center of the ball? Moreover, when using r=1 how does this interact with the plotting range (xmin,ymin)(xmax,ymax)? Working with your example, the range seems to have no effect on the plot (I even used (0,0)(0,0) instead of (-1,-1)(1,1)).<br>

<br>

for  \psSurface* (star version) only r is valid and for<br>

\psSurface only the x-y area.<br>

You can change the origin by using \rput:<br>

<br>

\documentclass{article}<br>

\usepackage[landscape]{geometry}<br>

\usepackage{pst-solides3d}<br>

\begin{document}<br>

<br>

\psset{viewpoint=50 30 30 rtp2xyz,Decran=100,lightsrc=viewpoint}<br>

\begin{pspicture}(-5,-4)(6,6)<br>

\psSolid[object=grille,base=-2 2 -2 2,action=draw]%<br>

\axesIIID(0,0,0)(2,2,1)<br>

\psSurface*[<br>

     fillcolor=cyan,r=1,<br>

     ngrid=.25 .25,incolor=yellow,grid,<br>

        algebraic](-1,-1)(1,1){ e^(x*y) }<br>

\psSolid[object=cylindre,r=1,h=2,action=draw,ngrid=1 18]<br>

\psPoint(0,0,1){O}<br>

\psPoint(0,0,3){Z}<br>

\psline{->}(O)(Z)<br>

\uput[r](Z){$z$}<br>

\psPoint(0.5,0.5,0){C}<br>

\psdot[linecolor=red,dotstyle=x,dotscale=2](C)<br>

\end{pspicture}<br>

%<br>

\begin{pspicture}(-5,-4)(6,6)<br>

\psSolid[object=grille,base=-2 2 -2 2,action=draw]%<br>

\axesIIID(0,0,0)(2,2,1)<br>

\psPoint(0.5,0.5,0){Origin}<br>

\rput(Origin){%<br>

        \psSurface*[<br>

        fillcolor=cyan,r=1,<br>

        ngrid=.25 .25,incolor=yellow,grid,<br>

        algebraic](-1,-1)(1,1){ e^(x*y) }}<br>

\psSolid[object=cylindre,r=1,h=2,action=draw,ngrid=1 18](0.5,0.5,0)<br>

\psPoint(0,0,1){O}<br>

\psPoint(0,0,3){Z}<br>

\psline{->}(O)(Z)<br>

\uput[r](Z){$z$}<br>

\psPoint(0.5,0.5,0){C}<br>

\psdot[linecolor=red,dotstyle=x,dotscale=2](C)<br>

\end{pspicture}<br>

<br>

\end{document}<br>

<br>

<br>

Herbert<br>

<br>

<br>

_______________________________________________<br>

PSTricks mailing list<br>

<a href="mailto:PSTricks@tug.org">PSTricks@tug.org</a><br>

<a href="http://tug.org/mailman/listinfo/pstricks" target="_blank">http://tug.org/mailman/listinfo/pstricks</a><br>

archive: <a href="http://www.tug.org/pipermail/pstricks/" target="_blank">http://www.tug.org/pipermail/pstricks/</a>_______________________________________________<br>

PSTricks mailing list<br>

<a href="mailto:PSTricks@tug.org">PSTricks@tug.org</a><br>

<a href="http://tug.org/mailman/listinfo/pstricks" target="_blank">http://tug.org/mailman/listinfo/pstricks</a><br>

archive: <a href="http://www.tug.org/pipermail/pstricks/" target="_blank">http://www.tug.org/pipermail/pstricks/</a></div>

</font>