748 Chapter 13 Computational Geometry Topics
The function
MergeSpatial performs the duties described earlier. By whatever
means, the visible faces of the current hull are removed, and the new faces formed
by the terminator and the next input point are added.
Divide-and-Conquer Method
The basic construction is similar to that in 2D. The input points are sorted along some
axis. The set of points is divided into two sets, and the hulls are computed recursively
on those sets. The resulting hulls are merged into a single hull with an algorithm that
is O(n) in time.
The idea is to wrap a plane about the two input hulls. The end result is a strip
consisting of triangles and/or quadrilaterals that become the new faces of the merged
hull. Figure 13.40 illustrates with two icosahedrons that are merged into a single
convex polyhedron. The wrapping begins by finding a supporting plane for the two
input hulls, a plane that is tangent to both hulls. For each hull the set of tangency is
either a vertex, an edge, or a face. If the set is a face, we need only consider a single
edge of the face, one visible to the other supporting set, to start the wrapping process.
Because we need only consider vertices and edges, the new faces on the merged hull
are either triangles or quadrilaterals.
Regardless of the type of supporting sets for the hulls, there must be vertices P
0
and Q
0
, one from each hull, so that the line segment P
0
, Q
0
is an edge of the merged
hull. One half of the supporting plane containing that edge is “folded” along the line
containing the edge until another hull vertex is encountered. If this vertex is on the
first hull, call it P
1
, then it must be adjacent to P
0
. The triangle P
0
, P
1
, Q
0
is a face of
the merged hull. Similarly, if the vertex is on the second hull, call it Q
1
, then it must
be adjacent to Q
0
. The triangle Q
0
, Q
1
, P is a face of the merged hull. It is possible
that both P
1
and Q
1
are encountered simultaneously, in which case the quadrilateral
formed by the four points is a face of the merged hull. The plane is folded again
on the line containing the next leading edge of the last found face. The process is
repeated until the original folding edge is revisited. As described in O’Rourke (1998),
the asymptotical analysis shows that the amortized cost for this search is O(n).
Once the merged hull faces are constructed by the plane wrapping, the old faces
that are no longer visible must be removed. In the 3D incremental hull construction,
the merge is applied to a single point and a convex polyhedron. Recall that the
terminator is the closed polyline of edges on the convex polyhedron that separates
the visible faces from the hidden ones relative to the single point. As a graph whose
nodes are the terminator vertices and whose arcs are the edges connecting consecutive
vertices, the terminator is a simple cycle. The merge step in the incremental hull
involved finding the terminator. The most efficient algorithm was to find an edge
of the terminator, then traverse adjacent edges of the terminator that separate two
faces, one of positive signed distance and one of nonpositive signed distance. This
traversal succeeds because the terminator is a simple cycle. Figure 13.40 might lead
you to believe that the terminators for the two input hulls are both simple cycles. As