TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to make a picture of some 3D boxes (i.e., parallelepipeds) that intersect themselves in some complicated ways, so I tried pst-solides3d.

Here's the minimal working example: A long and thin blue box should pierce a flat yellow box at its center.

    \psset{viewpoint=20 25 15,Decran=50,solidmemory}
        base=flatbox longbox]

The output is very strange: A piece of the thin box became yellow. It seems that the package is unable to determine which pieces of surfaces are in front.


With the option action=draw**, the result is even worse:

enter image description here

Am I doing something wrong?

share|improve this question
up vote 5 down vote accepted

You need more than the six polygon shapes of the blue cube to draw hidden surfaces. And, of course, all objects must be calculated with action=none except of the last one:

    \psset{viewpoint=20 25 15,Decran=50,solidmemory,action=none}
      \psSolid[name=l\iA, object=parallelepiped,a=0.3,b=.2,c=.2,
          fillcolor=blue](-0.75 \rA\space add .5 .5)}
        object=parallelepiped, a=.25,b=2,c=2,fillcolor=yellow](.5,.5,.5)
  \def\List{l0 }
  \psforeach{\iA}{1,2,..,10}{\xdef\List{\List\space l\iA\space }}
    \psSolid[object=fusion,action=draw**,base=flatbox \List]


enter image description here

share|improve this answer
Thanks for your answer. It's now clear that the package is less powerful than I expected, so boxes need to be partioned manually. – Jairo Bochi Jul 19 '14 at 21:44
it is simple to define a new object, which does this itself. – Herbert Jul 20 '14 at 5:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.