3

Using \psSolid I can create nice pictures of a graph of a function, say f(x,y)=xx-yy.

Using

\pstODE[algebraic,algebraicOutputFormat]{solution}{ "x" |"y" | f("x","y") }{...

I can solve an (high-dimensional) ODE and obtain a three-dimensional "curve" on the graph of f .

With listplotThreeD{solution} I can visualize this 3D-curve on the graph.

However, this curve will in general not lie on the graph created by \psSolid. For instance the output of ListplotThreeD will not change when changing the viewpoint in \psSolid.

Is there a way around that?

  • In one of his numerous examples, M. Luque defines the command \listplotIIID as an equivalent to the standard \listplotThreeD command, but compatible with the pst-solides3d package. – AlexG Jun 24 '15 at 15:14
3

pst-solides3d and pst-3dplot can be used together but the macros use a different coordinate system. You can define an on \listplotIIID as mentioned by Alexander as:

\makeatletter
\def\listplotIIID{\def\pst@par{}\pst@object{listplotIIID}}
\def\listplotIIID@i#1{%
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{%
   /viewpointXYZ {\pst@solides@viewpoint} def
   /Decran \pst@solides@Decran\space def % distance de l'ecran
    viewpointXYZ /ZpointVue ED /YpointVue ED /XpointVue ED
  /THETA {YpointVue XpointVue atan} bind def
  /PHI   {ZpointVue XpointVue dup mul YpointVue dup mul add sqrt atan} bind def
  /Dobs  {XpointVue dup mul YpointVue dup mul add ZpointVue dup mul add sqrt} bind def
  XpointVue YpointVue ZpointVue /viewpoint defpoint3d
    /XYZ [#1] def
  /@tabXYZ [
    0 3 XYZ length 3 sub {/i exch def
     XYZ i get
     XYZ i 1 add get
     XYZ i 2 add get
     3dto2d
     \pst@number\psunit mul exch
     \pst@number\psunit mul exch
    }  for
    ] bind def
 [ @tabXYZ aload pop
    }%
\@nameuse{endplot@\psplotstyle}}%
\makeatother

The data must be a file with 3d records like

1 2 3
4 5 1
2.1 0 1.1
...

The current viewport setting of pst-solides3d is valid.

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.