[pstricks] [pst-solides3D] define sommets from \psPoint

Herbert Voss Herbert.Voss at fu-berlin.de
Mon Apr 30 22:00:38 CEST 2018



Am 30.04.2018 um 11:41 schrieb Maxime Chupin:
>
> Is it possible to define sommets for un "object=new" from points 
> defined by \psPoint command ?
> I would like to draw a non regular tetrahedron, and label the edges.
> A very convenient way would be
>
> \psPoint(...){A}
> \psPoint(...){B}
> \psPoint(...){C}
> \psPoint(...){D}
>
> and
>
> \psSolid[object=new, sommets=
> (A) (B) (C) (D), ...
>
> Is there a way to do that?

No, that is not possible with the current code. The nodes are saved
with its 2D coordinates.

Howver, with a modification of the internal macros you can
save the points on PS level twith the 3d coordinates:


\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\pagestyle{empty}
\makeatletter
\def\psPoint at i(#1,#2,#3)#4{{% coordonnees cartesiennes
         %  \begin at SpecialObj
         \pnode(!
         \tx at optionssolides
         SolidesDict begin
         /#4 {#1 #2 #3} def
         #4
         3dto2d cm_1 exch cm_1 exch
         end){#4}%
         %  \end at SpecialObj
     }\ignorespaces%
}
\makeatother

\begin{document}
\begin{pspicture}(-4,-3)(4,3)
     \psPoint(-1,0,0){A}
     \psPoint(1,0,0){B}
     \psPoint(0,1,0){C}
     \psPoint(0.2,0,0.7){D}
\psSolid[object=new, sommets= A B C D,num=all,show=all, action=draw]
\axesIIID(-1.5,0,0)(1.5,1.5,1)
\end{pspicture}

\end{document}


Herbert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20180430/f8f0a87c/attachment.html>


More information about the PSTricks mailing list