Solution

ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/geometric-modelling/3/e/solution

Use the straightforward incremental three-dimensional convex hull algorithm. Assume distinct input points, at least four noncoplanar points, and general position with no four coplanar. Use exact orientation decisions, or robust predicates that certify the same signs. These assumptions avoid the separate bookkeeping for flat faces, points on the boundary and lower-dimensional initial data.
  1. Select four points forming a nondegenerate tetrahedron. Store its four triangular faces with outward normal vectors and consistent adjacency.
  2. For the next point , evaluate every current oriented face using
    The current hull lies in . Thus a face is visible from exactly when .
  3. If no face is visible, discard : it lies in the current convex hull. Otherwise identify the horizon of a convex polyhedron seen from , namely the edges incident with exactly one visible and one retained face.
  4. Delete the visible faces and cone the ordered horizon of a convex polyhedron to , adding one triangle per horizon edge. Orient each new face consistently outward and continue with the next point.
The determinant is six times the oriented volume of the tetrahedron ; only its sign matters. A zero value needs a declared degeneracy policy if the general-position assumption is relaxed.
The data structure update is a separate local operation. Mark visible faces and walk their adjacency to collect the horizon cycle before deleting anything. Remove edges with two visible incident faces; retain horizon edges and their retained-face links. Insert a vertex of a polyhedron record for and a new edge from to each horizon vertex of a polyhedron. Add one face per horizon edge, connect its other two edges to its neighbours in the cone, and replace the deleted face reference on each horizon edge. Restore the cyclic boundary references and each retained vertex of a polyhedron's incident-edge reference; remove any old vertices of a polyhedron left without incident faces.
For an outward visible face with boundary edge on the horizon, the new outward face can be ordered . Its retained neighbour already traverses that edge as . As an independent orientation check, an interior point of the old hull must evaluate negatively against the new face.
The correctness step is geometric: the nonvisible part of a convex polyhedron remains supporting, while sight lines from to the horizon create precisely the new supporting faces. Replacing the visible cap by its cone therefore gives
Induction from the initial tetrahedron yields the convex hull of all input points.

New to topics? Read the docs here!