[pstricks] 3D surface on non rectangular domain

leon.free at free.fr leon.free at free.fr
Sat Mar 4 13:56:10 CET 2017


Thank you Herbert.  
As with Manuel solution, yours also draws a line between the z-axis and the center of the ball on which the surface is draw. You can clearly see it by changing viewpoint to 50 340 20. Your test file with this value (see attached pdf produced when I compile it after copying pst-solides3d.tex, pst-solides3d.pro and pst-implicitsurface.pro on my system):

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

\psset{viewpoint=50 340 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}

Is this a problem with my own installation of pstricks, pst-solides3d or can it be reproduced on other systems?

elef



----- Mail original -----
De: "Herbert Voss" <Herbert.Voss at FU-Berlin.DE>
À: pstricks at tug.org
Envoyé: Vendredi 3 Mars 2017 11:04:44
Objet: Re: [pstricks] 3D surface on non rectangular domain

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




_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks
archive: http://www.tug.org/pipermail/pstricks/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testhv.pdf
Type: application/pdf
Size: 532662 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20170304/eb3908bb/attachment-0001.pdf>


More information about the PSTricks mailing list