# comp.graphics.algorithms

## Subject: Re: Joining points to form 3D convex polygon

Mark Thompson wrote:

> I am trying to find the intersection between a 3D triangle and a convex
> polyhedron. I have managed to work out a way of doing this by working
> out where each edge of the triangle intersects the polyhedron and also
> where each edge of the polyhedron intersects the triangle.

That's not very likely to be the optimal approach. You really should
reduce this to a 2D problem first (--> intersect polyhedron with the
plane of the triangle, gives you a convex polygon and a triangle in a
shared plane). Then you can use code like the Murta's Generic Polygon
Clipping library to to the rest, by setting up a coordinate system in
the polygon's plane. Looking at it from a different angle, you'd be
rotating the world so the triangle falls in the x-y plane (i.e. z=0),
cut the polyhedron by that plane, then do the rest of the job in (x,y)
only.

> arbitrary 3D plane) but I cannot see an easy way to determine how to
> traverse these points to describe the resultant convex polygon in 3D.

So don't do it in 3D --- do it in 2D.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.