This Demonstration shows the various 2D cross sections of a cube, a pyramid over a square, and an octahedron. Use the controls to see all possible cross sections.

The mechanism that generates the 2D cross section uses parametric equations of the lines that compose the edges of the solid. The equations are set equal to the height of the plane to generate the points of intersection.