Maximum number of vertices in intersection of triangle with box Suppose we have a triangle and a box in 3D.  The intersection of the triangle with the (solid) box will be a polygon with some number of vertices (possibly zero).  The vertex count will vary according to the precise shapes and positions of the triangle and box.
How can we establish the maximum number of vertices that this polygon could have, for any possible triangle and box?
Intuitively, an upper bound is 9 vertices because each plane of the box can add at most one vertex to the polygon, and the box has 6 planes.  But I'm not sure if this is a sharp upper bound; the problem's difficult enough to visualize that I can't convince myself either way.  Is there a geometry theorem that answers this?
 A: I agree the maximum is $9$ vertices. It's clear that the points where the triangle enters the box will all be vertices of the polygon. There is a maximum of $6$ such entry points, achieved when each of the $3$ sides enters and exits the box.
As a triangle edge pass through the box, the segment of the edge lying inside the box must form one edge of the polygon. In other words, no extra vertices are gained as the triangle passes inside the box.
When the triangle exits the box, at $A$, say, and then re-enters it, at $B$, say, we want maximal box edges lying between $A$ and $B$ because each such box edge will add an extra vertex to the polygon. We would place $A$ and $B$ therefore on opposite faces of the box but $A$ and $B$ being on different sides of a triangle prevents this. So the next best is to have $A$ and $B$ on adjacent faces of the box, in which case there is one box edge between them and hence one extra vertex for the polygon where that box edge intersects the plane of the triangle.
So we have $6$ vertices where the triangle edges enter the box, plus $3$ extra vertices from the box edges giving us $9$ in total.
It can be seen that this is in fact achievable with a little thought about positioning the triangle relative to the box as just described.

Colour codes: 


*

*Green : sides of triangle inside the cube

*Blue : sides of triangle outside the cube and visible

*Orange: sides of triangle outside the cube and hidden behind the cube

*Purple : sides of polygon on a cube face
The purple and green sides form the polygon.
A: An answer emerged from a couple of the comments, observing that


*

*The problem can be reduced to finding the intersection of the box with the triangle's plane, which produces a polygon, followed by the 2D problem of intersecting that polygon with the triangle.

*It's possible to cut a box with a plane in such a way that the intersection is a hexagon.


One can easily see that intersecting a triangle with a hexagon can give a nonagon, since each of the triangle's three edges can cut off one vertex of the hexagon.  So the upper bound of 9 vertices is fulfilled in such a case.
A: Just an illustration for some regular case represented as code for gnuplot:
set view equal xyz
set autoscale
set xyplane at -1
set xrange [-1:5]
set yrange [-1:5]
set zrange [-1:5]

$cube << EOI
0 0 0
4 0 0
4 0 4
4 4 4
0 4 4
0 4 0
0 0 0

0 0 4
0 0 0

0 0 4
4 0 4

0 0 4
0 4 4

4 4 0
4 4 4

4 4 0
4 0 0

4 4 0
0 4 0
EOI

$hexagon << EOI
2 0 0
4 0 2
4 2 4
2 4 4
0 4 2
0 2 0
2 0 0
EOI

$triangle << EOI
5 2 5
2 -1 -1
-1 5 2
5 2 5
EOI

set object 1 polygon from 1,1,0 to 2,0,0 to 3,0,1 to 4,1,3 to 4,2,4 to 3,3,4 to 1,4,3 to 0,4,2 to 0,3,1 to 1,1,0 fillstyle solid 0.5 noborder fillcolor rgb 'dark-green';
splot '$cube' with lines title 'cube', '$hexagon' with lines title 'hexagon', '$triangle' with lines notitle;

Just save in box_triangle_intersection.plt file and run gnuplot -p box_triangle_intersection.plt.
