<p>If two facets are not clearly convex, then Qhull removes one
or the other facet by merging the facet into a neighbor. It
selects the merge which minimizes the distance from the
neighboring hyperplane to the facet's vertices. Qhull also
performs merges when a facet has fewer than <i>d</i> neighbors (called a
degenerate facet), when a facet's vertices are included in a
neighboring facet's vertices (called a redundant facet), when a
facet's orientation is flipped, or when a ridge occurs between
more than two facets.</p>
<p>Qhull performs merges in a series of passes sorted by merge
angle. Each pass merges those facets which haven't already been
merged in that pass. After a pass, Qhull checks for redundant
vertices. For example, if a vertex has only two neighbors in 3-d,
the vertex is redundant and Qhull merges it into an adjacent
vertex.</p>
<p>Merging two simplicial facets creates a non-simplicial facet
of <em>d+1</em> vertices. Additional merges create larger facets.
When merging facet A into facet B, Qhull retains facet B's
hyperplane. It merges the vertices, neighbors, and ridges of both
facets. It recomputes the centrum if a wide merge has not
occurred (qh_WIDEcoplanar) and the number of extra vertices is
smaller than a constant (qh_MAXnewcentrum).</p>
<h2><ahref="#TOC">»</a><aname="limit">Limitations of merged
facets</a></h2>
<ul>
<li><b>Uneven dimensions</b> --
If one coordinate has a larger absolute value than other
coordinates, it may dominate the effect of roundoff errors on
distance computations. You may use option '<a
href="qh-optq.htm#QbB">QbB</a>' to scale points to the unit cube.
For Delaunay triangulations and Voronoi diagrams, <ahref=qdelaun.htm>qdelaunay</a>
and <ahref=qvoronoi.htm>qvoronoi</a> always set
option '<ahref="qh-optq.htm#Qbb">Qbb</a>'. It scales the last
coordinate to [0,m] where <i>m</i> is the maximum width of the
other coordinates. Option '<ahref="qh-optq.htm#Qbb">Qbb</a>' is
needed for Delaunay triangulations of integer coordinates
and nearly cocircular points.
<p>For example, compare
<pre>
rbox 1000 W0 t | qconvex Qb2:-1e-14B2:1e-14
</pre>
with
<pre>
rbox 1000 W0 t | qconvex
</pre>
The distributions are the same but the first is compressed to a 2e-14 slab.
<p>
<li><b>Post-merging of coplanar facets</b> -- In 5-d and higher, option '<ahref="qh-optq.htm#Qx">Qx</a>'
(default) delays merging of coplanar facets until post-merging.
This may allow "dents" to occur in the intermediate
convex hulls. A point may be poorly partitioned and force a poor
approximation. See option '<ahref="qh-optq.htm#Qx">Qx</a>' for
further discussion.</p>
<p>This is difficult to produce in 5-d and higher. Option '<ahref="qh-optq.htm#Q6">Q6</a>' turns off merging of concave
facets. This is similar to 'Qx'. It may lead to serious precision errors,
for example,
<pre>
rbox 10000 W1e-13 | qhull Q6 Tv
</pre>
<p>
<li><b>Maximum facet width</b> --
Qhull reports the maximum outer plane and inner planes (if
more than roundoff error apart). There is no upper bound
for either figure. This is an area for further research. Qhull
does a good job of post-merging in all dimensions. Qhull does a
good job of pre-merging in 2-d, 3-d, and 4-d. With the '<a
href="qh-optq.htm#Qx">Qx</a>' option, it does a good job in
higher dimensions. In 5-d and higher, Qhull does poorly at
detecting redundant vertices. </p>
<p>In the summary ('<ahref="qh-opto.htm#s">s</a>'), look at the
ratio between the maximum facet width and the maximum width of a
single merge, e.g., "(3.4x)". Qhull usually reports a
ratio of four or lower in 3-d and six or lower in 4-d. If it
reports a ratio greater than 10, this may indicate an
implementation error. Narrow distributions (see following) may
produce wide facets.
<p>For example, if special processing for narrow distributions is
turned off ('<ahref="qh-optq.htm#Q10">Q10</a>'), qhull may produce
a wide facet:</p>
<pre>
rbox 1000 L100000 s G1e-16 t1002074964 | qhull Tv Q10
</pre>
<p>
<li><b>Narrow distribution</b> -- In 3-d, a narrow distribution may result in a poor
approximation. For example, if you do not use qdelaunay nor option
'<ahref="qh-optq.htm#Qbb">Qbb</a>', the furthest-site
Delaunay triangulation of nearly cocircular points may produce a poor
approximation:
<pre>
rbox s 5000 W1e-13 D2 t1002151341 | qhull d Qt
rbox 1000 s W1e-13 t1002231672 | qhull d Tv
</pre>
<p>During
construction of the hull, a point may be above two
facets with opposite orientations that span the input
set. Even though the point may be nearly coplanar with both
facets, and can be distant from the precise convex
hull of the input sites. Additional facets leave the point distant from
a facet. To fix this problem, add option '<ahref="qh-optq.htm#Qbb">Qbb</a>'
(it scales the last coordinate). Option '<ahref="qh-optq.htm#Qbb">Qbb</a>'
is automatically set for <ahref=qdelaun.htm>qdelaunay</a> and <ahref=qvoronoi.htm>qvoronoi</a>.
<p>Qhull generates a warning if the initial simplex is narrow.
For narrow distributions, Qhull changes how it processes coplanar
points -- it does not make a point coplanar until the hull is
finished.
Use option '<ahref="qh-optq.htm#Q10">Q10</a>' to try Qhull without
special processing for narrow distributions.
For example, special processing is needed for:
<pre>
rbox 1000 L100000 s G1e-16 t1002074964 | qhull Tv Q10
</pre>
<p>You may turn off the warning message by reducing
qh_WARNnarrow in <tt>user.h</tt> or by setting option
'<ahref="qh-optp.htm#Pp">Pp</a>'. </p>
<p>Similar problems occur for distributions with a large flat facet surrounded
with many small facet at a sharp angle to the large facet.
Qhull 3.1 fixes most of these problems, but a poor approximation can occur.
A point may be left outside of the convex hull ('<ahref="qh-optt.htm#Tv">Tv</a>').
Examples include
the furthest-site Delaunay triangulation of nearly cocircular points plus the origin, and the convex hull of a cone of nearly cocircular points. The width of the band is 10^-13.
<pre>
rbox s 1000 W1e-13 P0 D2 t996799242 | qhull d Tv
rbox 1000 s Z1 G1e-13 t1002152123 | qhull Tv
rbox 1000 s Z1 G1e-13 t1002231668 | qhull Tv
</pre>
<p>
<li><b>Quadratic running time</b> -- If the output contains large, non-simplicial
facets, the running time for Qhull may be quadratic in the size of the triangulated
output. For example, <tt>rbox 1000 s W1e-13 c G2 | qhull d</tt> is 4 times
faster for 500 points. The convex hull contains two large nearly spherical facets and
many nearly coplanar facets. Each new point retriangulates the spherical facet and repartitions the remaining points into all of the nearly coplanar facets.
In this case, quadratic running time is avoided if you use qdelaunay,
add option '<ahref="qh-optq.htm#Qbb">Qbb</a>',
or add the origin ('P0') to the input.
<p>
<li><b>Nearly coincident points within 1e-13</b> --
Multiple, nearly coincident points within a 1e-13 ball of points in the unit cube
may lead to wide facets or quadratic running time.
For example, the convex hull a 1000 coincident, cospherical points in 4-D,
or the 3-D Delaunay triangulation of nearly coincident points, may lead to very
wide facets (e.g., 2267021951.3x).
<p>For Delaunay triangulations, the problem typically occurs for extreme points of the input
set (i.e., on the edge between the upper and lower convex hull). After multiple facet merges, four
facets may share the same, duplicate ridge and must be merged.
Some of these facets may be long and narrow, leading to a very wide merged facet.
If so, error QH6271 is reported. It may be overriden with option '<ahref="qh-optq.htm#Q12">Q12</a>'.
<p>Duplicate ridges occur when the horizon facets for a new point is "pinched".
In a duplicate ridge, a subridge (e.g., a line segment in 3-d) is shared by two horizon facets.
At least two of its vertices are nearly coincident. It is easy to generate coincident points with
option 'Cn,r,m' of rbox. It generates n points within an r ball for each of m input sites. For example,
every point of the following distributions has a nearly coincident point within a 1e-13 ball.
Substantially smaller or larger balls do not lead to pinched horizons.
<pre>
rbox 1000 C1,1e-13 D4 s t | qhull
rbox 75 C1,1e-13 t | qhull d
</pre>
For Delaunay triangulations, a bounding box may alleviate this error (e.g., <tt>rbox 500 C1,1E-13 t c G1 | qhull d</tt>).
A later release of qhull will avoid pinched horizons by merging duplicate subridges. A subridge is
merged by merging adjacent vertices.
<p>
<li><b>Facet with zero-area</b> --
It is possible for a zero-area facet to be convex with its
neighbors. This can occur if the hyperplanes of neighboring
facets are above the facet's centrum, and the facet's hyperplane
is above the neighboring centrums. Qhull computes the facet's
hyperplane so that it passes through the facet's vertices. The
vertices can be collinear. </p>
<p>
<li><b>No more facets</b> -- Qhull reports an error if there are <em>d+1</em> facets left
and two of the facets are not clearly convex. This typically
occurs when the convexity constraints are too strong or the input
points are degenerate. The former is more likely in 5-d and
higher -- especially with option '<ahref="qh-optc.htm#Cn">C-n</a>'.</p>
<p>
<li><b>Deleted cone</b> -- Lots of merging can end up deleting all
of the new facets for a point. This is a rare event that has
only been seen while debugging the code.
<p>
<li><b>Triangulated output leads to precision problems</b> -- With sufficient
merging, the ridges of a non-simplicial facet may have serious topological
and geometric problems. A ridge may be between more than two
neighboring facets. If so, their triangulation ('<ahref="qh-optq.htm#Qt">Qt</a>')
will fail since two facets have the same vertex set. Furthermore,
a triangulated facet may have flipped orientation compared to its
neighbors.</li>
<p>The triangulation process detects degenerate facets with
only two neighbors. These are marked degenerate. They have
zero area.
<p>
<li><b>Coplanar points</b> --
Option '<ahref="qh-optq.htm#Qc">Qc</a>' is determined by
qh_check_maxout() after constructing the hull. Qhull needs to
retain all possible coplanar points in the facets' coplanar sets.
This depends on qh_RATIOnearInside in <tt>user.h.</tt>
Furthermore, the cutoff for a coplanar point is arbitrarily set
at the minimum vertex. If coplanar points are important to your
application, remove the interior points by hand (set '<a
href="qh-optq.htm#Qc">Qc</a><ahref="qh-optq.htm#Qi">Qi</a>') or
make qh_RATIOnearInside sufficiently large.</p>
<p>
<li><b>Maximum roundoff error</b> -- Qhull computes the maximum roundoff error from the maximum
coordinates of the point set. Usually the maximum roundoff error
is a reasonable choice for all distance computations. The maximum
roundoff error could be computed separately for each point or for
each distance computation. This is expensive and it conflicts
with option '<ahref="qh-optc.htm#Cn">C-n</a>'.
<p>
<li><b>All flipped or upper Delaunay</b> -- When a lot of merging occurs for
Delaunay triangulations, a new point may lead to no good facets. For example,