4

Does pst-solides3d still have a mechanism for plotting level curves?

I say "still" because of the following lines in the manual


Changes compared to version 3.0

  • Suppression of the argument tracelignedeniveau

which (I guess) roughly translates to

  • trazar lineas de nivel => trace level curves

So, is this a dead feature? is it comming back? where is it if it is still there? how does/did it fare in comparison with implicit plot from pst-func?

  • 1
    pst-solides3d is a sophisticated package but with very "confusing" key-value naming convention such as grille, vecteur, and many more (I cannot remember them). We are forced to learn a new language. :-) – kiss my armpit Aug 25 '14 at 19:36
3

One can use Div which does the test for a zero division:

\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}

\begin{pspicture}(-3,-3)(3,3)
\psset{viewpoint=50 300 30 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSurface[
    ngrid=0.2 0.2,incolor=darkgray,linewidth=0.5\pslinewidth,
    intersectiontype=0,
    intersectionplan={ %lets make some planes from 0-1 with 0.25 step
        [0 0 1 -0.00]
        [0 0 1 -0.25]
        [0 0 1 -0.50]
        [0 0 1 -0.75]
        [0 0 1 -0.95]}, %close enough to 1
    intersectionlinewidth=1.5 1.5 1.5 1.5 1.5,
    intersectioncolor=(red)(green)(blue)(cyan)(magenta)](-3,-3)(3,3){
      x x mul y mul 2 mul 
      x 4 exp y 2 exp add  Div }
\end{pspicture}
\end{document}

enter image description here

  • I don't recall Div from PostScript. Is it defined in solides3d.pro? – hanzo2001 Sep 1 '14 at 12:23
  • in pstricks.pro – user2478 Sep 1 '14 at 18:49
0

I knew I would find a solution eventually

The family of options intersection~ are an impressive tool for tracing level curves on solids and surfaces.

  • intersectiontype, set to 0 to activate
  • intersectionplan, add flat surfaces of the following type ax+by+cz+d=0. Leave the definitions as follows [a b c d]

As an example I will use a surface on which I'm working on and leave the level curves on it for your amusement

\begin{pspicture}(-3,-3)(3,3)
\psset{viewpoint=50 300 30 rtp2xyz,Decran=50,lightsrc=viewpoint}
\psSurface[
    ngrid=0.2 0.2,incolor=darkgray,linewidth=0.5\pslinewidth,
    intersectiontype=0,
    intersectionplan={ %lets make some planes from 0-1 with 0.25 step
        [0 0 1 -0.00]
        [0 0 1 -0.25]
        [0 0 1 -0.50]
        [0 0 1 -0.75]
        [0 0 1 -0.95]}, %close enough to 1
    intersectionlinewidth=1.5 1.5 1.5 1.5 1.5,
    intersectioncolor=(black)(black)(black)(black)(black)
](-3,-3)(3,3){
    /denom x 4 exp y 2 exp add def
    /numer x x mul y mul 2 mul def
    denom 0 eq {0} {numer denom div} ifelse %gotta fix that div/0
}
\end{pspicture}

I think this will amuse anyone looking for a way to draw level curves. The planes I used on this example are all horizontal (z=k) but tweak it to whatever you need.

Any comments are welcome

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.