[pstricks] Drawing in 3D

Alan Ristow ristow at ece.gatech.edu
Thu Sep 30 01:16:54 CEST 2004


Hi,

I have several questions about 3D that I cannot seem to answer on my
own:

1. Is there a simple way to specify a clipping path in 3D, or do I need
to build complex shapes from primitives? What if I need, for example, to
draw a cylinder with a hole through the center, or a cube with a
circular hole in it?

2. Is there a way to fill the area between two shapes? In the example
below, I would like fill the area between the two concentric
\CircleThreeD objects without filling the interior circle.

3. When drawing an object such as a \CylindreThreeD, is it possible to
control the color of the end of the cylinder? Thus far, I have only been
able to do so by "capping" it with a circle filled with the color I
desire.

In the code example below, I have drawn two diagrams of an annular blade
slicing through a cylindrical object (an annular blade is shaped like an
"O" and has its sharp edge on the inside of the "O"). I need to fill the
area between the circles so it actually looks like a blade. In the
second diagram, I have used two cylinder primitives to make it appear as
though the blade is cutting through the cylinder.

Is this the most appropriate way to make a drawing such as this? I get
the impression that I am stretching the limits of 3D drawing with
PSTricks here....

Alan


\documentclass[letterpaper,11pt]{article}%
\usepackage{pst-vue3d}%

\pagestyle{empty}%

\begin{document}
  \psset{THETA=30,PHI=0,normaleLongitude=0,normaleLatitude=0,RotY=90}%

  % In this pspicture, the cylinder is centered inside the "blade".
  \begin{pspicture}(0,0)(10,5)

\CylindreThreeD[fillstyle=solid,fillcolor=gray,linestyle=none](0,0,0){5}{20}%
    \CircleThreeD(19,0,0){7}%
    \CircleThreeD(19,0,0){12}%
  \end{pspicture}

  % In this pspicture, the "blade" should look like it is cutting into 
	% the cylinder.
  \begin{pspicture}(0,0)(10,5)

\CylindreThreeD[fillstyle=solid,fillcolor=gray,linestyle=none](0,0,0){5}{19}%
    \CircleThreeD(19,0,-4){7}%
    \CircleThreeD(19,0,-4){12}%

\CylindreThreeD[fillstyle=solid,fillcolor=gray,linestyle=none](19,0,0){5}{1}%
  \end{pspicture}
\end{document}





More information about the PSTricks mailing list