# [pstricks] Learning internals example (seeking docs, tutorials)

Carsten Vogel (orphaned) lego at wh10.tu-dresden.de
Thu Mar 25 06:48:56 CET 2010

I.  Short Version
II. Long Version

Dear community,

I use PSTricks eversince (I can remember) and keen in using it.
Unfortunately I never made it beyond beginner's level. And I am willing
to change that (rewarding my graduation in math).

I. Short Version
================

Creating a non-standard graphical object I face repeatedly the lack of
dealing with coordinates. I would create for each pair of coordinates
two new lengths/dimens and I think thats not the way to do it.
I like to learn how to initialize, use and calculate with dimensions and
sets of coordinates (pair of two) in a effective way.
Any tutorial, demo, step-by-step approach, easy example to get into the
\pst at -world would help me. The code I found so far was steps beyond of
my understanding and featured several problems in one, so I could not
disclose the code needed to solve one problem at once alone.

Willing to read, try and suffer,
Carsten

(Does the latest edition of "PSTricks" cover that? I think I am two
editions late and would, of course buy a new copy if this topic is to be
found in there.)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

II. Long Version
================

The plot:
Up to now I started drawing static objects, but now I want to get more
into it. Planing objects I want to use, regarding effectivness (well,
not the time in the beginning but hey) and memory usage.

The example:
I want to create a 3D-box around a text, I order to become an element
(e.g. for powerdot) to use.

_______
/______/'
|      ||
| Text ||
|______|/

alt="ascii art ment to illustrate the idea"

The static approach would use e.g. \psframe* for drawing the rear box,
again the front box, a pspolygon to "shade" the side/top that needs a
third color, then I would center that (short) text in that box.
The drawbacks are clear: manual positioning using rput, each box need to
be adjusted and set up by hand.

Of course I found this one:
http://tug.org/PSTricks/main.cgi?file=Examples/Box/boxes

But even though the code is small it's somewhat magic and I cannot
differ between things necessary in my case nor those code-snipplets that
are mandatory for that "paragraph" mode only

What I am desperatly seeking is, somehow a sort of tutorial, a rough
sketch of planing an object like this. Even that low-level-section in
PSTricks-book (3rd? edt?) features "only" an hexagon which is too few
for my brain to abstract it.

To be more precise:
I see 7 verticies  (4 basic box limits and 3 3D ones) I would now use
\newlength x7
\setlength according to that object logic
and use these \Coord[1-7] to draw.

but I want something like
\pspolygon(0,0)(0,\Height)(\Depth,\Height+\Depth)(\Width+\Depth,\Height+\Depth)
so "inobject" calculation is the point that I am missing completely,
because right now, the only way to add \Height+\Depth is to create a new
dimension.

Cheers,
from Germany where the sun rises and it's about to become a nice day,
Carsten