# [pstricks] 3D surface on non rectangular domain

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri Mar 3 11:04:44 CET 2017

Am 02.03.2017 um 16:29 schrieb leon.free at free.fr:

> 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?

I see, I moved only the origin image to another location.
With pst-solids3d.tex and pst-solides3d.pro you have
Manuel's solution:
http://archiv.dante.de/~herbert/TeXnik/tex/generic/pst-solides3d/
http://archiv.dante.de/~herbert/TeXnik/dvips/pst-solides3d/pst-solides3d.pro

my testfile

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{pst-solides3d}
\begin{document}

\psset{viewpoint=50 20 20 rtp2xyz,Decran=100,lightsrc=viewpoint}
\begin{pspicture}(-5,-4)(6,6)
\psSolid[object=grille,base=-2 2 -2 2,action=draw]%
\axesIIID(0,0,0)(2,2,1)
\psSurface*[
fillcolor=cyan,r=1,
ngrid=.25 .25,incolor=yellow,grid,
algebraic](-1,-1)(1,1){ e^(x*y) }
\psSolid[object=cylindre,r=1,h=2,action=draw,ngrid=1 18]
\psPoint(0,0,1){O}
\psPoint(0,0,3){Z}
\psline{->}(O)(Z)
\uput[r](Z){$z$}
\psPoint(0.5,0.5,0){C}
\psdot[linecolor=red,dotstyle=x,dotscale=2](C)
\end{pspicture}
%
\begin{pspicture}(-5,-4)(6,10)
\psSolid[object=grille,base=-2 2 -2 2,action=draw]%
\axesIIID(0,0,0)(2,2,1)
\psSurface*[
fillcolor=cyan,r=1,xytranslate=0.5 0.5,
ngrid=.25 .25,incolor=yellow,grid,
algebraic](-1,-1)(1,1){ e^(x*y) }
\psSolid[object=cylindre,r=1,h=4,action=draw,ngrid=1 18](0.5,0.5,0)
\psPoint(0,0,1){O}
\psPoint(0,0,5){Z}
\psline{->}(O)(Z)
\uput[r](Z){$z$}
\psPoint(0.5,0.5,0){C}
\psdot[linecolor=red,dotstyle=x,dotscale=2](C)
\end{pspicture}

\end{document}

Herbert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto vom 2017-03-03 11-04-25.png
Type: image/png
Size: 56007 bytes
Desc: not available