[pstricks] pst-solides3d

Herbert Voss Herbert.Voss at fu-berlin.de
Fri Jan 4 21:17:33 CET 2019



Am 04.01.19 um 20:44 schrieb Poul Riis:

> Still, some remaining problems:
> 
> 1) Rather than the projected circle I would prefer to draw a circular 
> hole centered on the lid but I cannot make it work (see red lines in 
> project below). I get a ghostscript error, exit code 1.
> 
> 2) The (dummy) text seems to be behind the box, not in front as desired 
> (see green line in project below).

I have no idea what you really want to achieve. Howqever, with option
solidmemory all opjects are collected and printed  with respect to
hidden lines/surfaces. That is automatically done with \end{pspicture},
but can be done manually with \composeSolid if you want to plot some
more objects with the hidden option.

> \psProjection[object=cercle,definition=ABcercle,args=A B C,range=0 360,

use the simple definition with
object=cercle,args=0 0 Ax 3 mul,range=0 360

> \psSolid[object=courbe,r=0,range=0,linecolor=Blue1,linewidth=0.1,resolution=10,function=lidcircle]

range=0  cannot work

Herbert


\documentclass{article}
\usepackage[x11names]{xcolor}
\usepackage{pst-tools}
\usepackage{pst-solides3d}

\begin{document}
	\psset{unit=5mm}
	\begin{pspicture}[solidmemory](-10,-15)(10,15)
	\pstVerb{/aa 12 def /bb 8 def /cc 4 def /philid 30 def /radius 3 def 
/cosphi philid
		cos def /sinphi philid
		sin def /Mlidx cosphi 1 sub aa mul 2 div def /Mlidy 0 def /Mlidz 
sinphi aa mul 2
		div cc add def /nlidx
		sinphi neg def /nlidz cosphi def /Ax Mlidx def /Ay
		radius def /Az Mlidz def
		/Bx Mlidx radius cosphi mul add def /By 0 def /Bz Mlidz radius sinphi
		mul add def /Cx Mlidx
		def /Cy radius neg def /Cz Mlidz def /ex Ax Mlidx sub def /ey Ay Mlidy 
sub def /ez Az Mlidz
		sub def /fx Bx Mlidx sub def /fy By Mlidy sub def /fz Bz Mlidz sub def}
	\psset{viewpoint=100 30 20,Decran=200}
	\psSolid[
	object=parallelepiped,%
	a=aa,b=bb,c=cc,
	hollow,
	fillcolor=Green3,
	affinage=0,
	affinagecoeff=1,
	incolor=yellow](0,0,cc 2 div)
	\psSolid[object=plan,
   	  definition=normalpoint,
	  args={ Mlidx 0 Mlidz [sinphi 0 cosphi neg]},
	  fillcolor=Gold3,opacity=0.4,
	  base=aa neg 2 div
	       aa 2 div
	       bb neg 2 div
	       bb 2 div,showbase,
	name=myplane]
	\psset{plan=myplane}
	\psProjection[object=point,args=Ax Ay,name=A,action=none]
	\psProjection[object=point,args=Bx By,name=B,action=none]
	\psProjection[object=point,args=Cx Cy,name=C,action=none]
	\psProjection[object=cercle,args=0 0 Ax 3 mul,range=0 360,
	linecolor=Red1,
	fillstyle=solid,
	fillcolor=white]
	\composeSolid% Show all objects with hidden lines/surface
	\psset{action=draw**}
	\psPoint(aa 0.6 mul,0,0){Tx}
	\psPoint(0,bb 0.55 mul,0){Ty}
	\psPoint(aa 2 div,bb 0.55 mul neg,cc 2 div){Tz}
	\psPoint(Ax,Ay,Az){Alid}
	\psPoint(Bx,By,Bz){Blid}
	\psPoint(Cx,Cy,Cz){Clid}
	\psPoint(Mlidx,Mlidy,Mlidz){MAC}
	\defFunction{lidcircle}(t){t cos ex mul t sin fx mul add}%
	                          {t cos ey mul t sin fy mul add}%
	                          {t cos ez mul t sin fz mul add}
	\psSolid[object=courbe,r=0,range=0 360,linecolor=Blue1,
	   linewidth=0.1,resolution=100,function=lidcircle]
	\uput{0pt}[0]{0}(Tx){$x$}
	\uput{0pt}[0]{0}(Ty){$x$}
	\uput{0pt}[0]{0}(Tz){$h$}
	\uput{0pt}[0]{0}(MAC){abcdefghijklmnopqrstuvwxyz}
	\psline[linestyle=dashed](Alid)(Clid)
	\end{pspicture}
\end{document}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto vom 2019-01-04 21-12-32.png
Type: image/png
Size: 28518 bytes
Desc: not available
URL: <https://tug.org/pipermail/pstricks/attachments/20190104/5b0893ae/attachment-0001.png>


More information about the PSTricks mailing list