[pstricks] still confused by fusion

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Jul 25 21:36:54 CEST 2010


Am 25.07.2010 16:36, schrieb Zbigniew Nitecki:
> I've had a lot of help so far with this particular mini-project,
> and have succeeded in creating the ingredients for the figure I want.
> But the fusion part still eludes me. Can anyone explain the behavior noted below?
> *******************************************************************************
> First, the following code, in which each element is separate and has an 
> "action=draw**" command,
> produces the picture shown after the code:

use \psSurface only when you want to draw a single
3d function. When using a fusion then use always
\psSolid:

\listfiles
\documentclass[11pt]{article}
\usepackage{pst-solides3d, pst-3dplot, pst-math,pstricks-add}
\usepackage{pst-3d}
\begin{document}
\begin{pspicture}(-0.5,-2)(3,3)
\psset{lightsrc=50 20 50, viewpoint=15 60 70 rtp2xyz,
Decran=50}
\defFunction[algebraic]{Func}(x,y){}{}{ (x^2-3*y^2)/2 }
\psSolid[
  object=surface,
  fillcolor=lightgray,
  incolor=green,
  ngrid=0.1 0.1,
  base= -1 1 -1.5 1.5,
  function=Func,
  action=none,
  name=graphsurf]
\defFunction[algebraic]{curvey}(t){t}{1} {0.5*t^2-1.5}
\psSolid[%
  object=courbe,
  r=0.01,
  range=-1.0 1.0,
  resolution=720,
  linecolor=blue,
  linewidth=1pt,
  function=curvey,
  action=none,
  name=curvey,
]%
\defFunction[algebraic]{curvex}(t){0.5}{t}{0.125-1.5*t^2}
\psSolid[%
  object=courbe,
  r=0.01,
  range=-1.5 1.5,
  resolution=720,
  linecolor=white,
  linewidth=1pt,
  function=curvex,
  action=none,
  name=curvex,
]%
\psSolid[
  object=fusion,
  action=draw**,
  base=graphsurf curvey curvex,
]
\composeSolid
\end{pspicture}

\end{document}


However,
in this case you do not have a real fusion of the little
polygon snippets. You can draw only the two curves on
the surface:

\listfiles
\documentclass[11pt]{article}
\usepackage{pst-solides3d}
\begin{document}
\begin{pspicture}(-0.5,-2)(3,3)
\psset{lightsrc=50 20 50, viewpoint=15 60 70 rtp2xyz,
Decran=50}
\psSurface[
  fillcolor=lightgray,
  incolor=green,
  ngrid=0.1 0.1,
  algebraic,
](-1,-1.5)(1,1.5){ (x^2-3*y^2)/2 }
\defFunction[algebraic]{curvey}(t){t}{1} {0.5*t^2-1.5}
\psSolid[%
  object=courbe,
  r=0.01,
  range=-1 1,
  resolution=720,
  linecolor=white,
  linewidth=1pt,
  function=curvey,
]%
\defFunction[algebraic]{curvex}(t){0.5}{t}{0.125-1.5*t^2}
\psSolid[%
  object=courbe,
  r=0.01,
  range=-1 1.5,
  resolution=720,
  linecolor=white,
  linewidth=1pt,
  function=curvex,
]%
\end{pspicture}

\end{document}


and the last possibility is to draw intersectionlines of the surface
with the two plains x=0.5 and y=1, which is the easiest solution

\listfiles
\documentclass[11pt]{article}
\usepackage{pst-solides3d}
\begin{document}

\psset{lightsrc=50 20 50, viewpoint=15 60 70 rtp2xyz,Decran=50}
\begin{pspicture}(-0.5,-2)(3,3)
\psSurface[
  fillcolor=lightgray,
  incolor=green,
  ngrid=0.1 0.1,
  algebraic,
  intersectionplan={[1 0 0 -0.5][0 1 0 -1]}, % ax+by+cz+d=0
  intersectionlinewidth=2 2,
%  intersectioncolor=(bleu) (rouge),
  intersectiontype=0,
](-1,-1.5)(1,1.5){ (x^2-3*y^2)/2 }
\end{pspicture}

\end{document}

HErbert


More information about the PSTricks mailing list