1 | <!-- Do not edit with Front Page, it adds too many spaces -->
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Type"
|
---|
5 | content="text/html; charset=iso-8859-1">
|
---|
6 | <title>merge.c -- facet merge operations</title>
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 | <!-- Navigation links -->
|
---|
11 | <p><a name="TOP"><b>Up:</b></a> <a
|
---|
12 | href="http://www.qhull.org">Home page</a> for Qhull<br>
|
---|
13 | <b>Up:</b> <a href="../../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br>
|
---|
14 | <b>Up:</b> <a href="../../html/qh-quick.htm#programs">Programs</a>
|
---|
15 | • <a href="../../html/qh-quick.htm#options">Options</a>
|
---|
16 | • <a href="../../html/qh-opto.htm#output">Output</a>
|
---|
17 | • <a href="../../html/qh-optf.htm#format">Formats</a>
|
---|
18 | • <a href="../../html/qh-optg.htm#geomview">Geomview</a>
|
---|
19 | • <a href="../../html/qh-optp.htm#print">Print</a>
|
---|
20 | • <a href="../../html/qh-optq.htm#qhull">Qhull</a>
|
---|
21 | • <a href="../../html/qh-optc.htm#prec">Precision</a>
|
---|
22 | • <a href="../../html/qh-optt.htm#trace">Trace</a><br>
|
---|
23 | <b>Up:</b> <a href="../../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br>
|
---|
24 | <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br>
|
---|
25 | <b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a>
|
---|
26 | • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a>
|
---|
27 | • <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm">Poly</a>
|
---|
28 | • <a href="qh-qhull.htm">Qhull</a> • <a href="qh-set.htm">Set</a>
|
---|
29 | • <a href="qh-stat.htm">Stat</a> • <a href="qh-user.htm">User</a>
|
---|
30 | </p>
|
---|
31 | <hr>
|
---|
32 |
|
---|
33 | <h2>merge.c -- facet merge operations</h2>
|
---|
34 | <blockquote>
|
---|
35 | <p>Qhull handles precision problems by merged facets or joggled input.
|
---|
36 | Except for redundant vertices, it corrects a problem by
|
---|
37 | merging two facets. When done, all facets are clearly
|
---|
38 | convex. See <a href="../../html/qh-impre.htm">Imprecision in Qhull</a>
|
---|
39 | for further information. </p>
|
---|
40 | <p>Users may joggle the input ('<a href="../../html/qh-optq.htm#QJn">QJn</a>')
|
---|
41 | instead of merging facets. </p>
|
---|
42 | <p>Qhull detects and corrects the following problems: </p>
|
---|
43 | <ul>
|
---|
44 | <li><b>More than two facets meeting at a ridge. </b>When
|
---|
45 | Qhull creates facets, it creates an even number
|
---|
46 | of facets for each ridge. A convex hull always
|
---|
47 | has two facets for each ridge. More than two
|
---|
48 | facets may be created if non-adjacent facets
|
---|
49 | share a vertex. This is called a <em>duplicate
|
---|
50 | ridge</em>. In 2-d, a duplicate ridge would
|
---|
51 | create a loop of facets. </li>
|
---|
52 | </ul>
|
---|
53 | <ul>
|
---|
54 | <li><b>A facet contained in another facet. </b>Facet
|
---|
55 | merging may leave all vertices of one facet as a
|
---|
56 | subset of the vertices of another facet. This is
|
---|
57 | called a <em>redundant facet</em>. </li>
|
---|
58 | </ul>
|
---|
59 | <ul>
|
---|
60 | <li><b>A facet with fewer than three neighbors. </b>Facet
|
---|
61 | merging may leave a facet with one or two
|
---|
62 | neighbors. This is called a <em>degenerate facet</em>.
|
---|
63 | </li>
|
---|
64 | </ul>
|
---|
65 | <ul>
|
---|
66 | <li><b>A facet with flipped orientation. </b>A
|
---|
67 | facet's hyperplane may define a halfspace that
|
---|
68 | does not include the interior point.This is
|
---|
69 | called a <em>flipped facet</em>. </li>
|
---|
70 | </ul>
|
---|
71 | <ul>
|
---|
72 | <li><strong>A coplanar horizon facet.</strong> A
|
---|
73 | newly processed point may be coplanar with an
|
---|
74 | horizon facet. Qhull creates a new facet without
|
---|
75 | a hyperplane. It links new facets for the same
|
---|
76 | horizon facet together. This is called a <em>samecycle</em>.
|
---|
77 | The new facet or samecycle is merged into the
|
---|
78 | horizon facet. </li>
|
---|
79 | </ul>
|
---|
80 | <ul>
|
---|
81 | <li><b>Concave facets. </b>A facet's centrum may be
|
---|
82 | above a neighboring facet. If so, the facets meet
|
---|
83 | at a concave angle. </li>
|
---|
84 | </ul>
|
---|
85 | <ul>
|
---|
86 | <li><b>Coplanar facets. </b>A facet's centrum may be
|
---|
87 | coplanar with a neighboring facet (i.e., it is
|
---|
88 | neither clearly below nor clearly above the
|
---|
89 | facet's hyperplane). Qhull removes coplanar
|
---|
90 | facets in independent sets sorted by angle.</li>
|
---|
91 | </ul>
|
---|
92 | <ul>
|
---|
93 | <li><b>Redundant vertex. </b>A vertex may have fewer
|
---|
94 | than three neighboring facets. If so, it is
|
---|
95 | redundant and may be renamed to an adjacent
|
---|
96 | vertex without changing the topological
|
---|
97 | structure.This is called a <em>redundant vertex</em>.
|
---|
98 | </li>
|
---|
99 | </ul>
|
---|
100 | </blockquote>
|
---|
101 | <p><b>Copyright © 1995-2012 C.B. Barber</b></p>
|
---|
102 | <hr>
|
---|
103 | <p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a>
|
---|
104 | <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a>
|
---|
105 | • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a>
|
---|
106 | • <b>Merge</b> • <a href="qh-poly.htm#TOC">Poly</a>
|
---|
107 | • <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a>
|
---|
108 | • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a>
|
---|
109 | </p>
|
---|
110 | <h3>Index to <a href="merge.c">merge.c</a> and
|
---|
111 | <a href="merge.h">merge.h</a></h3>
|
---|
112 | <ul>
|
---|
113 | <li><a href="#mtype">merge.h data types, macros, and
|
---|
114 | global sets</a> </li>
|
---|
115 | <li><a href="#mconst">merge.h constants</a> </li>
|
---|
116 | </ul>
|
---|
117 | <ul>
|
---|
118 | <li><a href="#mtop">top-level merge functions</a> </li>
|
---|
119 | <li><a href="#mset">functions for identifying merges</a></li>
|
---|
120 | <li><a href="#mbest">functions for determining the
|
---|
121 | best merge</a> </li>
|
---|
122 | <li><a href="#mmerge">functions for merging facets</a>
|
---|
123 | </li>
|
---|
124 | <li><a href="#mcycle">functions for merging a cycle
|
---|
125 | of facets</a> </li>
|
---|
126 | <li><a href="#mrename">functions for renaming a
|
---|
127 | vertex</a> </li>
|
---|
128 | <li><a href="#mvertex">functions for identifying
|
---|
129 | vertices for renaming</a> </li>
|
---|
130 | <li><a href="#mcheck">functions for check and trace</a> </li>
|
---|
131 | </ul>
|
---|
132 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mtype">merge.h data
|
---|
133 | types, macros, and global sets</a></h3>
|
---|
134 | <ul>
|
---|
135 | <li><a href="merge.h#mergeT">mergeT</a> structure to
|
---|
136 | identify a merge of two facets</li>
|
---|
137 | <li><a href="merge.h#FOREACHmerge_">FOREACHmerge_</a>
|
---|
138 | assign 'merge' to each merge in merges </li>
|
---|
139 | <li><a href="libqhull.h#qh-set">qh global sets</a>
|
---|
140 | qh.facet_mergeset contains non-convex merges
|
---|
141 | while qh.degen_mergeset contains degenerate and
|
---|
142 | redundant facets</li>
|
---|
143 | </ul>
|
---|
144 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mconst">merge.h
|
---|
145 | constants</a></h3>
|
---|
146 | <ul>
|
---|
147 | <li><a href="libqhull.h#qh-prec">qh precision constants</a>
|
---|
148 | precision constants for Qhull </li>
|
---|
149 | <li><a href="merge.h#MRG">MRG...</a> indicates the
|
---|
150 | type of a merge (mergeT->type)</li>
|
---|
151 | <li><a href="merge.h#qh_ANGLEredundant">qh_ANGLEredundant</a>
|
---|
152 | indicates redundant merge in mergeT->angle </li>
|
---|
153 | <li><a href="merge.h#qh_ANGLEdegen">qh_ANGLEdegen</a>
|
---|
154 | indicates degenerate facet in mergeT->angle </li>
|
---|
155 | <li><a href="merge.h#qh_ANGLEconcave">qh_ANGLEconcave</a>
|
---|
156 | offset to indicate concave facets in
|
---|
157 | mergeT->angle </li>
|
---|
158 | <li><a href="merge.h#qh_MERGEapex">qh_MERGEapex</a>
|
---|
159 | flag for qh_mergefacet() to indicate an apex
|
---|
160 | merge </li>
|
---|
161 | </ul>
|
---|
162 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mtop">top-level merge
|
---|
163 | functions</a></h3>
|
---|
164 | <ul>
|
---|
165 | <li><a href="merge.c#all_merges">qh_all_merges</a>
|
---|
166 | merge all non-convex facets </li>
|
---|
167 | <li><a href="merge.c#checkzero">qh_checkzero</a>
|
---|
168 | check that facets are clearly convex </li>
|
---|
169 | <li><a href="merge.c#flippedmerges">qh_flippedmerges</a>
|
---|
170 | merge flipped facets into best neighbor </li>
|
---|
171 | <li><a href="merge.c#forcedmerges">qh_forcedmerges</a>
|
---|
172 | merge all duplicate ridges </li>
|
---|
173 | <li><a href="merge.c#merge_degenredundant">qh_merge_degenredundant</a>
|
---|
174 | merge degenerate and redundant facets </li>
|
---|
175 | <li><a href="merge.c#merge_nonconvex">qh_merge_nonconvex</a>
|
---|
176 | merge a non-convex ridge </li>
|
---|
177 | <li><a href="merge.c#premerge">qh_premerge</a>
|
---|
178 | pre-merge non-convex facets </li>
|
---|
179 | <li><a href="merge.c#postmerge">qh_postmerge</a>
|
---|
180 | post-merge nonconvex facets as defined by
|
---|
181 | maxcentrum/maxangle </li>
|
---|
182 | </ul>
|
---|
183 |
|
---|
184 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mset">functions for
|
---|
185 | identifying merges</a></h3>
|
---|
186 | <ul>
|
---|
187 | <li><a href="merge.c#appendmergeset">qh_appendmergeset</a>
|
---|
188 | appends an entry to qh.facet_mergeset</li>
|
---|
189 | <li><a href="merge.c#compareangle">qh_compareangle</a>
|
---|
190 | used by qsort() to order merges </li>
|
---|
191 | <li><a href="merge.c#comparemerge">qh_comparemerge</a>
|
---|
192 | used by qsort() to order merges </li>
|
---|
193 | <li><a href="merge.c#degen_redundant_facet">qh_degen_redundant_facet</a>
|
---|
194 | check for a degenerate and redundant facet</li>
|
---|
195 | <li><a href="merge.c#degen_redundant_neighbors">qh_degen_redundant_neighbors</a>
|
---|
196 | append degenerate and redundant neighbors to
|
---|
197 | qh.degen_mergeset </li>
|
---|
198 | <li><a href="merge.c#getmergeset_initial">qh_getmergeset_initial</a>
|
---|
199 | build initial qh.facet_mergeset </li>
|
---|
200 | <li><a href="merge.c#getmergeset">qh_getmergeset</a>
|
---|
201 | update qh.facet_mergeset </li>
|
---|
202 | <li><a href="merge.c#mark_dupridges">qh_mark_dupridges</a>
|
---|
203 | add duplicated ridges to qh.facet_mergeset</li>
|
---|
204 | <li><a href="merge.c#maydropneighbor">qh_maydropneighbor</a>
|
---|
205 | drop neighbor relationship if no ridge between
|
---|
206 | facet and neighbor </li>
|
---|
207 | <li><a href="merge.c#test_appendmerge">qh_test_appendmerge</a>
|
---|
208 | test a pair of facets for convexity and append to
|
---|
209 | qh.facet_mergeset if non-convex </li>
|
---|
210 | <li><a href="merge.c#test_vneighbors">qh_test_vneighbors</a>
|
---|
211 | test vertex neighbors for convexity </li>
|
---|
212 | </ul>
|
---|
213 |
|
---|
214 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mbest">functions for
|
---|
215 | determining the best merge</a></h3>
|
---|
216 | <ul>
|
---|
217 | <li><a href="merge.c#findbest_test">qh_findbest_test</a>
|
---|
218 | test neighbor for best merge </li>
|
---|
219 | <li><a href="merge.c#findbestneighbor">qh_findbestneighbor</a>
|
---|
220 | finds best neighbor of a facet for merging (i.e.,
|
---|
221 | closest hyperplane) </li>
|
---|
222 | </ul>
|
---|
223 |
|
---|
224 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mmerge">functions for
|
---|
225 | merging facets</a></h3>
|
---|
226 | <ul>
|
---|
227 | <li><a href="merge.c#copynonconvex">qh_copynonconvex</a>
|
---|
228 | copy non-convex flag to another ridge for the
|
---|
229 | same neighbor </li>
|
---|
230 | <li><a href="merge.c#makeridges">qh_makeridges</a>
|
---|
231 | creates explicit ridges between simplicial facets
|
---|
232 | </li>
|
---|
233 | <li><a href="merge.c#mergefacet">qh_mergefacet</a>
|
---|
234 | merges one facet into another facet</li>
|
---|
235 | <li><a href="merge.c#mergeneighbors">qh_mergeneighbors</a>
|
---|
236 | merges the neighbors of two facets </li>
|
---|
237 | <li><a href="merge.c#mergeridges">qh_mergeridges</a>
|
---|
238 | merges the ridge sets of two facets </li>
|
---|
239 | <li><a href="merge.c#mergesimplex">qh_mergesimplex</a>
|
---|
240 | merge a simplicial facet into another simplicial
|
---|
241 | facet </li>
|
---|
242 | <li><a href="merge.c#mergevertex_del">qh_mergevertex_del</a>
|
---|
243 | delete a vertex due to merging one facet into
|
---|
244 | another facet </li>
|
---|
245 | <li><a href="merge.c#mergevertex_neighbors">qh_mergevertex_neighbors</a>
|
---|
246 | merge the vertex neighbors of two facets </li>
|
---|
247 | <li><a href="merge.c#mergevertices">qh_mergevertices</a>
|
---|
248 | merge the vertex sets of two facets </li>
|
---|
249 | <li><a href="merge.c#newvertices">qh_newvertices</a>
|
---|
250 | register all vertices as new vertices </li>
|
---|
251 | <li><a href="merge.c#updatetested">qh_updatetested</a>
|
---|
252 | clear tested flags and centrums involved in a
|
---|
253 | merge </li>
|
---|
254 | <li><a href="merge.c#willdelete">qh_willdelete</a>
|
---|
255 | moves facet to qh.visible_list; sets replacement
|
---|
256 | or NULL </li>
|
---|
257 | </ul>
|
---|
258 |
|
---|
259 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mcycle">functions for
|
---|
260 | merging a cycle of facets</a></h3>
|
---|
261 | <p>If a point is coplanar with an horizon facet, the
|
---|
262 | corresponding new facets are linked together (a <em>samecycle</em>)
|
---|
263 | for merging.</p>
|
---|
264 | <ul>
|
---|
265 | <li><a href="merge.c#basevertices">qh_basevertices</a>
|
---|
266 | return temporary set of base vertices for a
|
---|
267 | samecycle </li>
|
---|
268 | <li><a href="merge.c#mergecycle">qh_mergecycle</a>
|
---|
269 | merge a samecycle into a horizon facet </li>
|
---|
270 | <li><a href="merge.c#mergecycle_all">qh_mergecycle_all</a>
|
---|
271 | merge all samecycles into horizon facets</li>
|
---|
272 | <li><a href="merge.c#mergecycle_facets">qh_mergecycle_facets</a>
|
---|
273 | finish merge of samecycle </li>
|
---|
274 | <li><a href="merge.c#mergecycle_neighbors">qh_mergecycle_neighbors</a>
|
---|
275 | merge neighbor sets for samecycle </li>
|
---|
276 | <li><a href="merge.c#mergecycle_ridges">qh_mergecycle_ridges</a>
|
---|
277 | merge ridge sets for samecycle </li>
|
---|
278 | <li><a href="merge.c#mergecycle_vneighbors">qh_mergecycle_vneighbors</a>
|
---|
279 | merge vertex neighbor sets for samecycle </li>
|
---|
280 | </ul>
|
---|
281 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mrename">functions
|
---|
282 | for renaming a vertex</a></h3>
|
---|
283 | <ul>
|
---|
284 | <li><a href="merge.c#comparevisit">qh_comparevisit</a>
|
---|
285 | used by qsort() to order vertices by visitid</li>
|
---|
286 | <li><a href="merge.c#reducevertices">qh_reducevertices</a>
|
---|
287 | reduce vertex sets </li>
|
---|
288 | <li><a href="merge.c#redundant_vertex">qh_redundant_vertex</a>
|
---|
289 | returns true if detect and rename redundant
|
---|
290 | vertex </li>
|
---|
291 | <li><a href="merge.c#rename_sharedvertex">qh_rename_sharedvertex</a>
|
---|
292 | detect and rename a shared vertex </li>
|
---|
293 | <li><a href="merge.c#renameridgevertex">qh_renameridgevertex</a>
|
---|
294 | rename oldvertex to newvertex in a ridge </li>
|
---|
295 | <li><a href="merge.c#renamevertex">qh_renamevertex</a>
|
---|
296 | rename oldvertex to newvertex in ridges </li>
|
---|
297 | <li><a href="merge.c#remove_extravertices">qh_remove_extravertices</a>
|
---|
298 | remove extra vertices in non-simplicial facets </li>
|
---|
299 | </ul>
|
---|
300 |
|
---|
301 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mvertex">functions
|
---|
302 | for identifying vertices for renaming</a></h3>
|
---|
303 | <ul>
|
---|
304 | <li><a href="merge.c#find_newvertex">qh_find_newvertex</a>
|
---|
305 | locate new vertex for renaming old vertex </li>
|
---|
306 | <li><a href="merge.c#hashridge">qh_hashridge</a> add
|
---|
307 | ridge to hashtable </li>
|
---|
308 | <li><a href="merge.c#hashridge_find">qh_hashridge_find</a>
|
---|
309 | returns matching ridge in hashtable</li>
|
---|
310 | <li><a href="merge.c#neighbor_intersections">qh_neighbor_intersections</a>
|
---|
311 | return intersection of vertex sets for
|
---|
312 | neighboring facets </li>
|
---|
313 | <li><a href="merge.c#vertexridges">qh_vertexridges</a>
|
---|
314 | return temporary set of ridges adjacent to a
|
---|
315 | vertex </li>
|
---|
316 | <li><a href="merge.c#vertexridges_facet">qh_vertexridges_facet</a>
|
---|
317 | add adjacent ridges for a vertex in facet </li>
|
---|
318 | </ul>
|
---|
319 |
|
---|
320 | <h3><a href="qh-merge.htm#TOC">»</a><a name="mcheck">functions for check and
|
---|
321 | trace</a></h3>
|
---|
322 | <ul>
|
---|
323 | <li><a href="merge.c#checkconnect">qh_checkconnect</a>
|
---|
324 | check that new facets are connected </li>
|
---|
325 | <li><a href="merge.c#tracemerge">qh_tracemerge</a>
|
---|
326 | print trace message after merge </li>
|
---|
327 | <li><a href="merge.c#tracemerging">qh_tracemerging</a>
|
---|
328 | print trace message during post-merging </li>
|
---|
329 | </ul>
|
---|
330 |
|
---|
331 | <p><!-- Navigation links --> </p>
|
---|
332 | <hr>
|
---|
333 | <p><b>Up:</b>
|
---|
334 | <a href="http://www.qhull.org">Home page for
|
---|
335 | Qhull</a> <br>
|
---|
336 | <b>Up:</b> <a href="../../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br>
|
---|
337 | <b>Up:</b> <a href="../../html/qh-quick.htm#programs">Programs</a>
|
---|
338 | • <a href="../../html/qh-quick.htm#options">Options</a>
|
---|
339 | • <a href="../../html/qh-opto.htm#output">Output</a>
|
---|
340 | • <a href="../../html/qh-optf.htm#format">Formats</a>
|
---|
341 | • <a href="../../html/qh-optg.htm#geomview">Geomview</a>
|
---|
342 | • <a href="../../html/qh-optp.htm#print">Print</a>
|
---|
343 | • <a href="../../html/qh-optq.htm#qhull">Qhull</a>
|
---|
344 | • <a href="../../html/qh-optc.htm#prec">Precision</a>
|
---|
345 | • <a href="../../html/qh-optt.htm#trace">Trace</a><br>
|
---|
346 | <b>Up:</b> <a href="../../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br>
|
---|
347 | <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br>
|
---|
348 | <b>To:</b> <a href="qh-geom.htm">Geom</a> •
|
---|
349 | <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a>
|
---|
350 | • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a>
|
---|
351 | • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a>
|
---|
352 | • <a href="qh-set.htm">Set</a> • <a href="qh-stat.htm">Stat</a>
|
---|
353 | • <a href="qh-user.htm">User</a><br>
|
---|
354 | </p>
|
---|
355 | <p><!-- GC common information --> </p>
|
---|
356 | <hr>
|
---|
357 | <p><a href="http://www.geom.uiuc.edu/"><img
|
---|
358 | src="../../html/qh--geom.gif" align="middle" width="40" height="40"></a><i>The
|
---|
359 | Geometry Center Home Page </i></p>
|
---|
360 | <p>Comments to: <a href=mailto:qhull@qhull.org>qhull@qhull.org</a>
|
---|
361 | </a><br>
|
---|
362 | Created: May 2, 1997 --- <!-- hhmts start --> Last modified: see top <!-- hhmts end --> </p>
|
---|
363 | </body>
|
---|
364 | </html>
|
---|