# 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?

-
What does a polygon with 0 vertices look like? Do you mean how many of the triangle's and box's vertices are in the intersection? –  Hao Ye Jul 8 '14 at 0:55
@HaoYe By "0 vertices" I just mean that the intersection could be empty. No, I don't mean original vertices of the triangle and box, I just mean the corners of the polygon created by intersecting them. –  Nathan Reed Jul 8 '14 at 1:36
I think the problem simplifies to what is the shape of intersection of a triangle and a polygon $P$, where $P$ is the intersection of the box and some plane. You should be able to find some $P$ that is a hexagon, which you can intersect with a triangle to get a nonagon -> 9 vertices. –  Hao Ye Jul 8 '14 at 3:32
A box-plane intersection forming a hexagon is shown halfway down this page, and one can easily truncate three of its vertices with a triangle. –  Rahul Jul 8 '14 at 13:25
@HaoYe That's a good point. Would you mind posting that as an answer? –  Nathan Reed Jul 8 '14 at 22:51

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.

-