Debian Codegraph @

vendor/qhull/libqhull_r/poly2_r.c

raw symbols SCIP
1 /*<html><pre> -<a href="qh-poly_r.htm"
2 >-------------------------------</a><a name="TOP">-</a>
3
4 poly2_r.c
5 implements polygons and simplicies
6
7 see qh-poly_r.htm, poly_r.h and libqhull_r.h
8
9 frequently used code is in poly_r.c
10
11 Copyright (c) 1993-2020 The Geometry Center.
12 $Id: //main/2019/qhull/src/libqhull_r/poly2_r.c#22 $$Change: 3978 $
13 $DateTime: 2025/08/24 21:38:45 $$Author: bbarber $
14 */
15
16 #include "qhull_ra.h"cxx . . $ `<file>/vendor/qhull/libqhull_r/qhull_ra.h`/
17
18 /*======== functions in alphabetical order ==========*/
19
20 /*-<a href="qh-poly_r.htm#TOC"
21 >-------------------------------</a><a name="addfacetvertex">-</a>
22
23 qh_addfacetvertex(qh, facet, newvertex )
24 add newvertex to facet.vertices if not already there
25 vertices are inverse sorted by vertex->id
26
27 returns:
28 True if new vertex for facet
29
30 notes:
31 see qh_replacefacetvertex
32 */
33 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! qh_addfacetvertexcxx . . $ qh_addfacetvertex(220ef636088a7937).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet, vertexTcxx . . $ vertexT# *newvertex) {
34 vertexTcxx . . $ vertexT# *vertex;
35 int vertex_i= 0, vertex_n;
36 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! isnew= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
37
38 FOREACHvertex_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1125:9`!(qh, facet->vertices) {
39 if (vertex->idcxx . . $ vertexT#id. < newvertex->idcxx . . $ vertexT#id.) {
40 break;
41 }else if (vertex->idcxx . . $ vertexT#id. == newvertex->idcxx . . $ vertexT#id.) {
42 isnew= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
43 break;
44 }
45 }
46 if (isnew)
47 qh_setaddnthcxx . . $ qh_setaddnth(4353c65cb7d1d819).(qh, &facet->verticescxx . . $ facetT#vertices., vertex_i, newvertex);
48 return isnew;
49 } /* addfacetvertex */
50
51 /*-<a href="qh-poly_r.htm#TOC"
52 >-------------------------------</a><a name="addhash">-</a>
53
54 qh_addhash( newelem, hashtable, hashsize, hash )
55 add newelem to linear hash table at hash if not already there
56 */
57 void qh_addhashcxx . . $ qh_addhash(ab618b2d2adda5ae).(void *newelem, setTcxx . . $ setT# *hashtable, int hashsize, int hash) {
58 int scan;
59 void *elem;
60
61 for (scan= (int)hash; (elem= SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(hashtable, scan));
62 scan= (++scan >= hashsize ? 0 : scan)) {
63 if (elem == newelem)
64 break;
65 }
66 /* loop terminates because qh_HASHfactor >= 1.1 by qh_initbuffers */
67 if (!elem)
68 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(hashtable, scan)= newelem;
69 } /* addhash */
70
71 /*-<a href="qh-poly_r.htm#TOC"
72 >-------------------------------</a><a name="check_bestdist">-</a>
73
74 qh_check_bestdist(qh)
75 check that all points are within max_outside of the nearest facet
76 if qh.ONLYgood,
77 ignores !good facets
78
79 see:
80 qh_check_maxout(), qh_outerinner()
81
82 notes:
83 only called from qh_check_points()
84 seldom used since qh.MERGING is almost always set
85 if notverified>0 at end of routine
86 some points were well inside the hull. If the hull contains
87 a lens-shaped component, these points were not verified. Use
88 options 'Qi Tv' to verify all points. (Exhaustive check also verifies)
89
90 design:
91 determine facet for each point (if any)
92 for each point
93 start with the assigned facet or with the first facet
94 find the best facet for the point and check all coplanar facets
95 error if point is outside of facet
96 */
97 void qh_check_bestdistcxx . . $ qh_check_bestdist(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
98 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, unassigned;
99 facetTcxx . . $ facetT# *facet, *bestfacet, *errfacet1= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *errfacet2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
100 facetTcxx . . $ facetT# *facetlist;
101 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist, maxoutside, maxdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
102 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point;
103 int numpart= 0, facet_i, facet_n, notgood= 0, notverified= 0;
104 setTcxx . . $ setT# *facets;
105
106 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1020, "qh_check_bestdist: check points below nearest facet. Facet_list f%d\n",
107 qh->facet_list->id));
108 maxoutside= qh_maxoutercxx . . $ qh_maxouter(733abb61795913aa).(qh);
109 maxoutside += qh->DISTroundcxx . . $ qhT#DISTround.;
110 /* one more qh.DISTround for check computation */
111 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1021, "qh_check_bestdist: check that all points are within %2.2g of best facet\n", maxoutside));
112 facets= qh_pointfacetcxx . . $ qh_pointfacet(34607698aa694009).(qh /* qh.facet_list */);
113 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`! && qh->PRINTprecisioncxx . . $ qhT#PRINTprecision.)
114 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8091, "\n\
115 qhull output completed. Verifying that %d points are\n\
116 below %2.2g of the nearest %sfacet.\n",
117 qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facets), maxoutside, (qh->ONLYgoodcxx . . $ qhT#ONLYgood. ? "good " : ""));
118 FOREACHfacet_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1064:9`!(qh, facets) { /* for each point with facet assignment */
119 if (facet)
120 unassigned= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
121 else {
122 unassigned= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
123 facet= qh->facet_listcxx . . $ qhT#facet_list.;
124 }
125 point= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, facet_i);
126 if (point == qh->GOODpointpcxx . . $ qhT#GOODpointp.)
127 continue;
128 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
129 numpart++;
130 bestfacet= qh_findbesthorizoncxx . . $ qh_findbesthorizon(6dbbca6914aed351).(qh, !qh_IScheckmaxcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:191:9`!, point, facet, qh_NOuppercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:190:9`!, &dist, &numpart);
131 /* occurs after statistics reported */
132 maximize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:51:9`!(maxdist, dist);
133 if (dist > maxoutside) {
134 if (qh->ONLYgoodcxx . . $ qhT#ONLYgood. && !bestfacet->goodcxx . . $ facetT#good.
135 && !((bestfacet= qh_findgooddistcxx . . $ qh_findgooddist(5bc06be2015e8222).(qh, point, bestfacet, &dist, &facetlist))
136 && dist > maxoutside))
137 notgood++;
138 else {
139 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
140 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6109, "qhull precision error (qh_check_bestdist): point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n",
141 facet_i, bestfacet->idcxx . . $ facetT#id., dist, maxoutside);
142 if (errfacet1 != bestfacet) {
143 errfacet2= errfacet1;
144 errfacet1= bestfacet;
145 }
146 }
147 }else if (unassigned && dist < -qh->MAXcoplanarcxx . . $ qhT#MAXcoplanar.)
148 notverified++;
149 }
150 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &facets);
151 if (notverified && !qh->DELAUNAYcxx . . $ qhT#DELAUNAY. && !qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`! && qh->PRINTprecisioncxx . . $ qhT#PRINTprecision.)
152 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8092, "\n%d points were well inside the hull. If the hull contains\n\
153 a lens-shaped component, these points were not verified. Use\n\
154 options 'Qci Tv' to verify all points.\n", notverified);
155 if (maxdist > qh->outside_errcxx . . $ qhT#outside_err.) {
156 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6110, "qhull precision error (qh_check_bestdist): a coplanar point is %6.2g from convex hull. The maximum value is qh.outside_err (%6.2g)\n",
157 maxdist, qh->outside_errcxx . . $ qhT#outside_err.);
158 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!, errfacet1, errfacet2);
159 }else if (waserror && qh->outside_errcxx . . $ qhT#outside_err. > REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2)
160 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!, errfacet1, errfacet2);
161 /* else if waserror, the error was logged to qh.ferr but does not effect the output */
162 trace0cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:87:9`!((qh, qh->ferr, 20, "qh_check_bestdist: max distance outside %2.2g\n", maxdist));
163 } /* check_bestdist */
164
165 #ifndef qh_NOmerge
166 /*-<a href="qh-poly_r.htm#TOC"
167 >-------------------------------</a><a name="check_maxout">-</a>
168
169 qh_check_maxout(qh)
170 updates qh.max_outside by checking all points against bestfacet
171 if qh.ONLYgood, ignores !good facets
172
173 returns:
174 updates facet->maxoutside via qh_findbesthorizon()
175 sets qh.maxoutdone
176 if printing qh.min_vertex (qh_outerinner),
177 it is updated to the current vertices
178 removes inside/coplanar points from coplanarset as needed
179
180 notes:
181 defines coplanar as qh.min_vertex instead of qh.MAXcoplanar
182 may not need to check near-inside points because of qh.MAXcoplanar
183 and qh.KEEPnearinside (before it was -qh.DISTround)
184
185 see also:
186 qh_check_bestdist()
187
188 design:
189 if qh.min_vertex is needed
190 for all neighbors of all vertices
191 test distance from vertex to neighbor
192 determine facet for each point (if any)
193 for each point with an assigned facet
194 find the best facet for the point and check all coplanar facets
195 (updates outer planes)
196 remove near-inside points from coplanar sets
197 */
198 void qh_check_maxoutcxx . . $ qh_check_maxout(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
199 facetTcxx . . $ facetT# *facet, *bestfacet, *neighbor, **neighborp, *facetlist, *maxbestfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *minfacet, *maxfacet, *maxpointfacet;
200 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist, maxoutside, mindist, nearest;
201 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! maxoutside_base, minvertex_base;
202 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, *maxpoint= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
203 int numpart= 0, facet_i, facet_n, notgood= 0;
204 setTcxx . . $ setT# *facets, *vertices;
205 vertexTcxx . . $ vertexT# *vertex, *minvertex;
206
207 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1022, "qh_check_maxout: check and update qh.min_vertex %2.2g and qh.max_outside %2.2g\n", qh->min_vertex, qh->max_outside));
208 minvertex_base= fmin_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:43:9`!(qh->min_vertex, -(qh->ONEmerge+qh->DISTround));
209 maxoutside= mindist= 0.0;
210 minvertex= qh->vertex_listcxx . . $ qhT#vertex_list.;
211 maxfacet= minfacet= maxpointfacet= qh->facet_listcxx . . $ qhT#facet_list.;
212 if (qh->VERTEXneighborscxx . . $ qhT#VERTEXneighbors.
213 && (qh->PRINTsummarycxx . . $ qhT#PRINTsummary. || qh->KEEPinsidecxx . . $ qhT#KEEPinside. || qh->KEEPcoplanarcxx . . $ qhT#KEEPcoplanar.
214 || qh->TRACElevelcxx . . $ qhT#TRACElevel. || qh->PRINTstatisticscxx . . $ qhT#PRINTstatistics. || qh->VERIFYoutputcxx . . $ qhT#VERIFYoutput. || qh->CHECKfrequentlycxx . . $ qhT#CHECKfrequently.
215 || qh->PRINToutcxx . . $ qhT#PRINTout.[0] == qh_PRINTsummarycxx . . $ qh_PRINTsummary. || qh->PRINToutcxx . . $ qhT#PRINTout.[0] == qh_PRINTnonecxx . . $ qh_PRINTnone.)) {
216 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1023, "qh_check_maxout: determine actual minvertex\n"));
217 vertices= qh_pointvertexcxx . . $ qh_pointvertex(34607698aa694009).(qh /* qh.facet_list */);
218 FORALLverticescxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:961:9`! {
219 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(vertex) {
220 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zdistvertex); /* distance also computed by main loop below */
221 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, vertex->pointcxx . . $ vertexT#point., neighbor, &dist);
222 if (dist < mindist) {
223 if (qh->min_vertexcxx . . $ qhT#min_vertex./minvertex_base > qh_WIDEmaxoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:984:9`! && (qh->PRINTprecisioncxx . . $ qhT#PRINTprecision. || !qh->ALLOWwidecxx . . $ qhT#ALLOWwide.)) {
224 nearest= qh_vertex_bestdistcxx . . $ qh_vertex_bestdist(ca5ef81fc8e259a7).(qh, neighbor->verticescxx . . $ facetT#vertices.);
225 /* should be caught in qh_mergefacet */
226 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7083, "Qhull precision warning: in post-processing (qh_check_maxout) p%d(v%d) is %2.2g below f%d nearest vertices %2.2g\n",
227 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.), vertex->idcxx . . $ vertexT#id., dist, neighbor->idcxx . . $ facetT#id., nearest);
228 }
229 mindist= dist;
230 minvertex= vertex;
231 minfacet= neighbor;
232 }
233 #ifndef qh_NOtracecxx . . $ `vendor/qhull/libqhull_r/user_r.h:627:9`!
234 if (-dist > qh->TRACEdist || dist > qh->TRACEdist
235 || neighbor == qh->tracefacet || vertex == qh->tracevertex) {
236 nearest= qh_vertex_bestdist(qh, neighbor->vertices);
237 qh_fprintf(qh, qh->ferr, 8093, "qh_check_maxout: p%d(v%d) is %.2g from f%d nearest vertices %2.2g\n",
238 qh_pointid(qh, vertex->point), vertex->id, dist, neighbor->id, nearest);
239 }
240 #endif
241 }
242 }
243 if (qh->MERGINGcxx . . $ qhT#MERGING.) {
244 wmin_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:489:9`!(Wminvertex, qh->min_vertex);
245 }
246 qh->min_vertexcxx . . $ qhT#min_vertex.= mindist;
247 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &vertices);
248 }
249 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1055, "qh_check_maxout: determine actual maxoutside\n"));
250 maxoutside_base= fmax_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:35:9`!(qh->max_outside, qh->ONEmerge+qh->DISTround);
251 /* maxoutside_base is same as qh.MAXoutside without qh.MINoutside (qh_detmaxoutside) */
252 facets= qh_pointfacetcxx . . $ qh_pointfacet(34607698aa694009).(qh /* qh.facet_list */);
253 FOREACHfacet_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1064:9`!(qh, facets) { /* for each point with facet assignment */
254 if (facet) {
255 point= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, facet_i);
256 if (point == qh->GOODpointpcxx . . $ qhT#GOODpointp.)
257 continue;
258 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Ztotcheck);
259 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
260 numpart++;
261 bestfacet= qh_findbesthorizoncxx . . $ qh_findbesthorizon(6dbbca6914aed351).(qh, qh_IScheckmaxcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:191:9`!, point, facet, !qh_NOuppercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:190:9`!, &dist, &numpart);
262 if (bestfacet && dist >= maxoutside) {
263 if (qh->ONLYgoodcxx . . $ qhT#ONLYgood. && !bestfacet->goodcxx . . $ facetT#good.
264 && !((bestfacet= qh_findgooddistcxx . . $ qh_findgooddist(5bc06be2015e8222).(qh, point, bestfacet, &dist, &facetlist))
265 && dist > maxoutside)) {
266 notgood++;
267 }else if (dist/maxoutside_base > qh_WIDEmaxoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:984:9`! && (qh->PRINTprecisioncxx . . $ qhT#PRINTprecision. || !qh->ALLOWwidecxx . . $ qhT#ALLOWwide.)) {
268 nearest= qh_vertex_bestdistcxx . . $ qh_vertex_bestdist(ca5ef81fc8e259a7).(qh, bestfacet->verticescxx . . $ facetT#vertices.);
269 if (nearest < fmax_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:35:9`!(qh->ONEmerge, qh->max_outside) * qh_RATIOcoplanaroutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:821:9`! * 2) {
270 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7087, "Qhull precision warning: in post-processing (qh_check_maxout) p%d for f%d is %2.2g above twisted facet f%d nearest vertices %2.2g\n",
271 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, point), facet->idcxx . . $ facetT#id., dist, bestfacet->idcxx . . $ facetT#id., nearest);
272 }else {
273 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7088, "Qhull precision warning: in post-processing (qh_check_maxout) p%d for f%d is %2.2g above hidden facet f%d nearest vertices %2.2g\n",
274 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, point), facet->idcxx . . $ facetT#id., dist, bestfacet->idcxx . . $ facetT#id., nearest);
275 }
276 maxbestfacet= bestfacet;
277 }
278 maxoutside= dist;
279 maxfacet= bestfacet;
280 maxpoint= point;
281 maxpointfacet= facet;
282 }
283 if (dist > qh->TRACEdistcxx . . $ qhT#TRACEdist. || (bestfacet && bestfacet == qh->tracefacetcxx . . $ qhT#tracefacet.))
284 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8094, "qh_check_maxout: p%d is %.2g above f%d\n",
285 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, point), dist, (bestfacet ? bestfacet->idcxx . . $ facetT#id. : UINT_MAXcxx . . $ `<external>/67164224788392828/limits.h:124:9`!));
286 }
287 }
288 zzadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:437:9`!(Zcheckpart, numpart);
289 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &facets);
290 wval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:460:9`!(Wmaxout)= maxoutside - qh->max_outsidecxx . . $ qhT#max_outside.;
291 wmax_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:475:9`!(Wmaxoutside, qh->max_outside);
292 if (!qh->APPROXhullcxx . . $ qhT#APPROXhull. && maxoutside > qh->DISTroundcxx . . $ qhT#DISTround.) { /* initial value for f.maxoutside */
293 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
294 if (maxoutside < facet->maxoutsidecxx . . $ facetT#maxoutside.) {
295 if (!qh->KEEPcoplanarcxx . . $ qhT#KEEPcoplanar.) {
296 maxoutside= facet->maxoutsidecxx . . $ facetT#maxoutside.;
297 }else if (maxoutside + qh->DISTroundcxx . . $ qhT#DISTround. < facet->maxoutsidecxx . . $ facetT#maxoutside.) { /* maxoutside is computed distance, e.g., rbox 100 s D3 t1547136913 | qhull R1e-3 Tcv Qc */
298 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7082, "Qhull precision warning (qh_check_maxout): f%d.maxoutside (%4.4g) is greater than computed qh.max_outside (%2.2g) + qh.DISTround (%2.2g). It should be less than or equal\n",
299 facet->idcxx . . $ facetT#id., facet->maxoutsidecxx . . $ facetT#maxoutside., maxoutside, qh->DISTroundcxx . . $ qhT#DISTround.);
300 }
301 }
302 }
303 }
304 qh->max_outsidecxx . . $ qhT#max_outside.= maxoutside;
305 qh_nearcoplanarcxx . . $ qh_nearcoplanar(fb32973c8cc8eae9).(qh /* qh.facet_list */);
306 qh->maxoutdonecxx . . $ qhT#maxoutdone.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
307 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1024, "qh_check_maxout: p%d(v%d) is qh.min_vertex %2.2g below facet f%d. Point p%d for f%d is qh.max_outside %2.2g above f%d. %d points are outside of not-good facets\n",
308 qh_pointid(qh, minvertex->point), minvertex->id, qh->min_vertex, minfacet->id, qh_pointid(qh, maxpoint), maxpointfacet->id, qh->max_outside, maxfacet->id, notgood));
309 if(!qh->ALLOWwidecxx . . $ qhT#ALLOWwide.) {
310 if (maxoutside/maxoutside_base > qh_WIDEmaxoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:984:9`!) {
311 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6297, "Qhull precision error (qh_check_maxout): large increase in qh.max_outside during post-processing dist %2.2g (%.1fx). See warning QH0032/QH0033. Allow with 'Q12' (allow-wide) and 'Pp'\n",
312 maxoutside, maxoutside/maxoutside_base);
313 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRwidecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:210:9`!, maxbestfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
314 }else if (!qh->APPROXhullcxx . . $ qhT#APPROXhull. && maxoutside_base > (qh->ONEmergecxx . . $ qhT#ONEmerge. * qh_WIDEmaxoutside2cxx . . $ `vendor/qhull/libqhull_r/user_r.h:994:9`!)) {
315 if (maxoutside > (qh->ONEmergecxx . . $ qhT#ONEmerge. * qh_WIDEmaxoutside2cxx . . $ `vendor/qhull/libqhull_r/user_r.h:994:9`!)) { /* wide facets may have been deleted */
316 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6298, "Qhull precision error (qh_check_maxout): a facet merge, vertex merge, vertex, or coplanar point produced a wide facet %2.2g (%.1fx). Trace with option 'TWn' to identify the merge. Allow with 'Q12' (allow-wide)\n",
317 maxoutside_base, maxoutside_base/(qh->ONEmergecxx . . $ qhT#ONEmerge. + qh->DISTroundcxx . . $ qhT#DISTround.));
318 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRwidecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:210:9`!, maxbestfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
319 }
320 }else if (qh->min_vertexcxx . . $ qhT#min_vertex./minvertex_base > qh_WIDEmaxoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:984:9`!) {
321 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6354, "Qhull precision error (qh_check_maxout): large increase in qh.min_vertex during post-processing dist %2.2g (%.1fx). See warning QH7083. Allow with 'Q12' (allow-wide) and 'Pp'\n",
322 qh->min_vertexcxx . . $ qhT#min_vertex., qh->min_vertexcxx . . $ qhT#min_vertex./minvertex_base);
323 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRwidecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:210:9`!, minfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
324 }else if (minvertex_base < -(qh->ONEmergecxx . . $ qhT#ONEmerge. * qh_WIDEmaxoutside2cxx . . $ `vendor/qhull/libqhull_r/user_r.h:994:9`!)) {
325 if (qh->min_vertexcxx . . $ qhT#min_vertex. < -(qh->ONEmergecxx . . $ qhT#ONEmerge. * qh_WIDEmaxoutside2cxx . . $ `vendor/qhull/libqhull_r/user_r.h:994:9`!)) { /* wide facets may have been deleted */
326 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6380, "Qhull precision error (qh_check_maxout): a facet or vertex merge produced a wide facet: v%d below f%d distance %2.2g (%.1fx). Trace with option 'TWn' to identify the merge. Allow with 'Q12' (allow-wide)\n",
327 minvertex->idcxx . . $ vertexT#id., minfacet->idcxx . . $ facetT#id., mindist, -qh->min_vertexcxx . . $ qhT#min_vertex./(qh->ONEmergecxx . . $ qhT#ONEmerge. + qh->DISTroundcxx . . $ qhT#DISTround.));
328 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRwidecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:210:9`!, minfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
329 }
330 }
331 }
332 } /* check_maxout */
333 #else /* qh_NOmerge */
334 void qh_check_maxout(qhT *qh) {
335 QHULL_UNUSED(qh)
336 }
337 #endif
338
339 /*-<a href="qh-poly_r.htm#TOC"
340 >-------------------------------</a><a name="check_output">-</a>
341
342 qh_check_output(qh)
343 performs the checks at the end of qhull algorithm
344 Maybe called after Voronoi output. If so, it recomputes centrums since they are Voronoi centers instead.
345 */
346 void qh_check_outputcxx . . $ qh_check_output(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
347 int i;
348
349 if (qh->STOPconecxx . . $ qhT#STOPcone.)
350 return;
351 if (qh->VERIFYoutputcxx . . $ qhT#VERIFYoutput. || qh->IStracingcxx . . $ qhT#IStracing. || qh->CHECKfrequentlycxx . . $ qhT#CHECKfrequently.) {
352 qh_checkpolygoncxx . . $ qh_checkpolygon(6436bdf99f629b76).(qh, qh->facet_listcxx . . $ qhT#facet_list.);
353 qh_checkflipped_allcxx . . $ qh_checkflipped_all(6436bdf99f629b76).(qh, qh->facet_listcxx . . $ qhT#facet_list.);
354 qh_checkconvexcxx . . $ qh_checkconvex(3625443eafc1ad63).(qh, qh->facet_listcxx . . $ qhT#facet_list., qh_ALGORITHMfaultcxx . . $ `vendor/qhull/libqhull_r/poly_r.h:27:9`!);
355 }else if (!qh->MERGINGcxx . . $ qhT#MERGING. && qh_newstatscxx . . $ qh_newstats(a9f4975698954d4a).(qh, qh->qhstatcxx . . $ qhT#qhstat..precisioncxx . . $ qhstatT#precision., &i)) {
356 qh_checkflipped_allcxx . . $ qh_checkflipped_all(6436bdf99f629b76).(qh, qh->facet_listcxx . . $ qhT#facet_list.);
357 qh_checkconvexcxx . . $ qh_checkconvex(3625443eafc1ad63).(qh, qh->facet_listcxx . . $ qhT#facet_list., qh_ALGORITHMfaultcxx . . $ `vendor/qhull/libqhull_r/poly_r.h:27:9`!);
358 }
359 } /* check_output */
360
361
362
363 /*-<a href="qh-poly_r.htm#TOC"
364 >-------------------------------</a><a name="check_point">-</a>
365
366 qh_check_point(qh, point, facet, maxoutside, maxdist, errfacet1, errfacet2, errcount )
367 check that point is less than maxoutside from facet
368
369 notes:
370 only called from qh_checkpoints
371 reports up to qh_MAXcheckpoint-1 errors per facet
372 */
373 void qh_check_pointcxx . . $ qh_check_point(aa07b921bd24e530).(qhTcxx . . $ qhT# *qh, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, facetTcxx . . $ facetT# *facet, realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! *maxoutside, realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! *maxdist, facetTcxx . . $ facetT# **errfacet1, facetTcxx . . $ facetT# **errfacet2, int *errcount) {
374 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist, nearest;
375
376 /* occurs after statistics reported */
377 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
378 maximize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:51:9`!(*maxdist, dist);
379 if (dist > *maxoutside) {
380 (*errcount)++;
381 if (*errfacet1 != facet) {
382 *errfacet2= *errfacet1;
383 *errfacet1= facet;
384 }
385 if (*errcount < qh_MAXcheckpointcxx . . $ `vendor/qhull/libqhull_r/user_r.h:740:9`!) {
386 nearest= qh_vertex_bestdistcxx . . $ qh_vertex_bestdist(ca5ef81fc8e259a7).(qh, facet->verticescxx . . $ facetT#vertices.);
387 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6111, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g nearest vertices %2.2g\n",
388 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, point), facet->idcxx . . $ facetT#id., dist, *maxoutside, nearest);
389 }
390 }
391 } /* qh_check_point */
392
393
394 /*-<a href="qh-poly_r.htm#TOC"
395 >-------------------------------</a><a name="check_points">-</a>
396
397 qh_check_points(qh)
398 checks that all points are inside all facets
399
400 notes:
401 if many points and qh_check_maxout not called (i.e., !qh.MERGING),
402 calls qh_findbesthorizon via qh_check_bestdist (seldom done).
403 ignores flipped facets
404 maxoutside includes 2 qh.DISTrounds
405 one qh.DISTround for the computed distances in qh_check_points
406 qh_printafacet and qh_printsummary needs only one qh.DISTround
407 the computation for qh.VERIFYdirect does not account for qh.other_points
408
409 design:
410 if many points
411 use qh_check_bestdist()
412 else
413 for all facets
414 for all points
415 check that point is inside facet
416 */
417 void qh_check_pointscxx . . $ qh_check_points(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
418 facetTcxx . . $ facetT# *facet, *errfacet1= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *errfacet2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
419 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! total, maxoutside, maxdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
420 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, **pointp, *pointtemp;
421 int errcount;
422 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! testouter;
423
424 maxoutside= qh_maxoutercxx . . $ qh_maxouter(733abb61795913aa).(qh);
425 maxoutside += qh->DISTroundcxx . . $ qhT#DISTround.;
426 /* one more qh.DISTround for check computation */
427 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1025, "qh_check_points: check all points below %2.2g of all facet planes\n",
428 maxoutside));
429 if (qh->num_goodcxx . . $ qhT#num_good.) /* miss counts other_points and !good facets */
430 total= (realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`!)qh->num_goodcxx . . $ qhT#num_good. * (realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`!)qh->num_pointscxx . . $ qhT#num_points.;
431 else
432 total= (realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`!)qh->num_facetscxx . . $ qhT#num_facets. * (realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`!)qh->num_pointscxx . . $ qhT#num_points.;
433 if (total >= qh_VERIFYdirectcxx . . $ `vendor/qhull/libqhull_r/user_r.h:441:9`! && !qh->maxoutdonecxx . . $ qhT#maxoutdone.) {
434 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`! && qh->SKIPcheckmaxcxx . . $ qhT#SKIPcheckmax. && qh->MERGINGcxx . . $ qhT#MERGING.)
435 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7075, "qhull input warning: merging without checking outer planes('Q5' or 'Po'). Verify may report that a point is outside of a facet.\n");
436 qh_check_bestdistcxx . . $ qh_check_bestdist(fb32973c8cc8eae9).(qh);
437 }else {
438 if (qh_MAXoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:589:9`! && qh->maxoutdonecxx . . $ qhT#maxoutdone.)
439 testouter= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
440 else
441 testouter= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
442 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
443 if (qh->MERGEexactcxx . . $ qhT#MERGEexact.)
444 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7076, "qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx\n");
445 else if (qh->SKIPcheckmaxcxx . . $ qhT#SKIPcheckmax. || qh->NOnearinsidecxx . . $ qhT#NOnearinside.)
446 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7077, "qhull input warning: no outer plane check ('Q5') or no processing of near-inside points ('Q8'). Verify may report that a point is outside of a facet.\n");
447 }
448 if (qh->PRINTprecisioncxx . . $ qhT#PRINTprecision.) {
449 if (testouter)
450 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8098, "\n\
451 Output completed. Verifying that all points are below outer planes of\n\
452 all %sfacets. Will make %2.0f distance computations.\n",
453 (qh->ONLYgoodcxx . . $ qhT#ONLYgood. ? "good " : ""), total);
454 else
455 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8099, "\n\
456 Output completed. Verifying that all points are below %2.2g of\n\
457 all %sfacets. Will make %2.0f distance computations.\n",
458 maxoutside, (qh->ONLYgoodcxx . . $ qhT#ONLYgood. ? "good " : ""), total);
459 }
460 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
461 if (!facet->goodcxx . . $ facetT#good. && qh->ONLYgoodcxx . . $ qhT#ONLYgood.)
462 continue;
463 if (facet->flippedcxx . . $ facetT#flipped.)
464 continue;
465 if (!facet->normalcxx . . $ facetT#normal.) {
466 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7061, "qhull warning (qh_check_points): missing normal for facet f%d\n", facet->idcxx . . $ facetT#id.);
467 if (!errfacet1)
468 errfacet1= facet;
469 continue;
470 }
471 if (testouter) {
472 #if qh_MAXoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:589:9`!
473 maxoutside= facet->maxoutsidecxx . . $ facetT#maxoutside. + 2 * qh->DISTroundcxx . . $ qhT#DISTround.;
474 /* one DISTround to actual point and another to computed point */
475 #endif
476 }
477 errcount= 0;
478 FORALLpointscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:934:9`! {
479 if (point != qh->GOODpointpcxx . . $ qhT#GOODpointp.)
480 qh_check_pointcxx . . $ qh_check_point(aa07b921bd24e530).(qh, point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2, &errcount);
481 }
482 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(qh->other_points) {
483 if (point != qh->GOODpointpcxx . . $ qhT#GOODpointp.)
484 qh_check_pointcxx . . $ qh_check_point(aa07b921bd24e530).(qh, point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2, &errcount);
485 }
486 if (errcount >= qh_MAXcheckpointcxx . . $ `vendor/qhull/libqhull_r/user_r.h:740:9`!) {
487 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6422, "qhull precision error (qh_check_points): %d additional points outside facet f%d, maxdist= %6.8g\n",
488 errcount-qh_MAXcheckpointcxx . . $ `vendor/qhull/libqhull_r/user_r.h:740:9`!+1, facet->idcxx . . $ facetT#id., maxdist);
489 }
490 }
491 if (maxdist > qh->outside_errcxx . . $ qhT#outside_err.) {
492 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6112, "qhull precision error (qh_check_points): a coplanar point is %6.2g from convex hull. The maximum value(qh.outside_err) is %6.2g\n",
493 maxdist, qh->outside_errcxx . . $ qhT#outside_err. );
494 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!, errfacet1, errfacet2 );
495 }else if (errfacet1 && qh->outside_errcxx . . $ qhT#outside_err. > REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2)
496 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!, errfacet1, errfacet2 );
497 /* else if errfacet1, the error was logged to qh.ferr but does not effect the output */
498 trace0cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:87:9`!((qh, qh->ferr, 21, "qh_check_points: max distance outside %2.2g\n", maxdist));
499 }
500 } /* check_points */
501
502
503 /*-<a href="qh-poly_r.htm#TOC"
504 >-------------------------------</a><a name="checkconvex">-</a>
505
506 qh_checkconvex(qh, facetlist, fault )
507 check that each ridge in facetlist is convex
508 fault = qh_DATAfault if reporting errors from qh_initialhull with qh.ZEROcentrum
509 = qh_ALGORITHMfault otherwise
510
511 returns:
512 counts Zconcaveridges and Zcoplanarridges
513 errors if !qh.FORCEoutput ('Fo') and concaveridge or if merging a coplanar ridge
514 overwrites Voronoi centers if set by qh_setvoronoi_all/qh_ASvoronoi
515
516 notes:
517 called by qh_initial_hull, qh_check_output, qh_all_merges ('Tc'), qh_build_withrestart ('QJ')
518 does not test f.tricoplanar facets (qh_triangulate)
519 must be no stronger than qh_test_appendmerge
520 if not merging,
521 tests vertices for neighboring simplicial facets < -qh.DISTround
522 else if ZEROcentrum and simplicial facet,
523 tests vertices for neighboring simplicial facets < 0.0
524 tests centrums of neighboring nonsimplicial facets < 0.0
525 else if ZEROcentrum
526 tests centrums of neighboring facets < 0.0
527 else
528 tests centrums of neighboring facets < -qh.DISTround ('En' 'Rn')
529 Does not test against -qh.centrum_radius since repeated computations may have different round-off errors (e.g., 'Rn')
530
531 design:
532 for all facets
533 report flipped facets
534 if ZEROcentrum and simplicial neighbors
535 test vertices against neighbor
536 else
537 test centrum against neighbor
538 */
539 void qh_checkconvexcxx . . $ qh_checkconvex(3625443eafc1ad63).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist, int fault) {
540 facetTcxx . . $ facetT# *facet, *neighbor, **neighborp, *errfacet1=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *errfacet2=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
541 vertexTcxx . . $ vertexT# *vertex;
542 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist;
543 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *centrum;
544 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, centrum_warning= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, tempcentrum= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, first_nonsimplicial= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, tested_simplicial, allsimplicial;
545 int neighbor_i, neighbor_n;
546
547 if (qh->ZEROcentrumcxx . . $ qhT#ZEROcentrum.) {
548 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1064, "qh_checkconvex: check that facets are not-flipped and for qh.ZEROcentrum that simplicial vertices are below their neighbor (dist<0.0)\n"));
549 first_nonsimplicial= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
550 }else if (!qh->MERGINGcxx . . $ qhT#MERGING.) {
551 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1026, "qh_checkconvex: check that facets are not-flipped and that simplicial vertices are convex by qh.DISTround ('En', 'Rn')\n"));
552 first_nonsimplicial= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
553 }else
554 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1062, "qh_checkconvex: check that facets are not-flipped and that their centrums are convex by qh.DISTround ('En', 'Rn') \n"));
555 if (!qh->RERUNcxx . . $ qhT#RERUN.) {
556 zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Zconcaveridges)= 0;
557 zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Zcoplanarridges)= 0;
558 }
559 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
560 if (facet->flippedcxx . . $ facetT#flipped.) {
561 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "flipped facet"); /* also tested by qh_checkflipped */
562 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6113, "qhull precision error: f%d is flipped (interior point is outside)\n",
563 facet->idcxx . . $ facetT#id.);
564 errfacet1= facet;
565 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
566 continue;
567 }
568 if (facet->tricoplanarcxx . . $ facetT#tricoplanar.)
569 continue;
570 if (qh->MERGINGcxx . . $ qhT#MERGING. && (!qh->ZEROcentrumcxx . . $ qhT#ZEROcentrum. || !facet->simplicialcxx . . $ facetT#simplicial.)) {
571 allsimplicial= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
572 tested_simplicial= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
573 }else {
574 allsimplicial= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
575 tested_simplicial= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
576 FOREACHneighbor_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1080:9`!(qh, facet) {
577 if (neighbor->tricoplanarcxx . . $ facetT#tricoplanar.)
578 continue;
579 if (!neighbor->simplicialcxx . . $ facetT#simplicial.) {
580 allsimplicial= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
581 continue;
582 }
583 vertex= SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(facet->vertices, neighbor_i, vertexT);
584 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, vertex->pointcxx . . $ vertexT#point., neighbor, &dist);
585 if (dist >= -qh->DISTroundcxx . . $ qhT#DISTround.) {
586 if (fault == qh_DATAfaultcxx . . $ `vendor/qhull/libqhull_r/poly_r.h:35:9`!) {
587 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "non-convex initial simplex");
588 if (dist > qh->DISTroundcxx . . $ qhT#DISTround.)
589 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6114, "qhull precision error: initial simplex is not convex, since p%d(v%d) is %6.4g above opposite f%d\n",
590 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.), vertex->idcxx . . $ vertexT#id., dist, neighbor->idcxx . . $ facetT#id.);
591 else
592 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6379, "qhull precision error: initial simplex is not convex, since p%d(v%d) is within roundoff of opposite facet f%d (dist %6.4g)\n",
593 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.), vertex->idcxx . . $ vertexT#id., neighbor->idcxx . . $ facetT#id., dist);
594 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRsingularcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:204:9`!, neighbor, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
595 }
596 if (dist > qh->DISTroundcxx . . $ qhT#DISTround.) {
597 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zconcaveridges);
598 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "concave ridge");
599 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6115, "qhull precision error: f%d is concave to f%d, since p%d(v%d) is %6.4g above f%d\n",
600 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.), vertex->idcxx . . $ vertexT#id., dist, neighbor->idcxx . . $ facetT#id.);
601 errfacet1= facet;
602 errfacet2= neighbor;
603 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
604 }else if (qh->ZEROcentrumcxx . . $ qhT#ZEROcentrum.) {
605 if (dist > 0.0) { /* qh_checkzero checked convex (dist < (- 2*qh->DISTround)), computation may differ e.g. 'Rn' */
606 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zcoplanarridges);
607 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "coplanar ridge");
608 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6116, "qhull precision error: f%d is clearly not convex to f%d, since p%d(v%d) is %6.4g above or coplanar with f%d with qh.ZEROcentrum\n",
609 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.), vertex->idcxx . . $ vertexT#id., dist, neighbor->idcxx . . $ facetT#id.);
610 errfacet1= facet;
611 errfacet2= neighbor;
612 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
613 }
614 }else {
615 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zcoplanarridges);
616 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "coplanar ridge");
617 trace0cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:87:9`!((qh, qh->ferr, 22, "qhull precision error: f%d is coplanar to f%d, since p%d(v%d) is within %6.4g of f%d, during p%d\n",
618 facet->id, neighbor->id, qh_pointid(qh, vertex->point), vertex->id, dist, neighbor->id, qh->furthest_id));
619 }
620 }
621 }
622 }
623 if (!allsimplicial) {
624 if (first_nonsimplicial) {
625 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1063, "qh_checkconvex: starting with f%d, also check that centrums of non-simplicial ridges are below their neighbors (dist<0.0)\n",
626 facet->id));
627 first_nonsimplicial= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
628 }
629 if (qh->CENTERtypecxx . . $ qhT#CENTERtype. == qh_AScentrumcxx . . $ qh_AScentrum.) {
630 if (!facet->centercxx . . $ facetT#center.)
631 facet->centercxx . . $ facetT#center.= qh_getcentrumcxx . . $ qh_getcentrum(b7c5d1c2575d3b75).(qh, facet);
632 centrum= facet->centercxx . . $ facetT#center.;
633 }else {
634 if (!centrum_warning && !facet->simplicialcxx . . $ facetT#simplicial.) { /* recomputed centrum correct for simplicial facets */
635 centrum_warning= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
636 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7062, "qhull warning: recomputing centrums for convexity test. This may lead to false, precision errors.\n");
637 }
638 centrum= qh_getcentrumcxx . . $ qh_getcentrum(b7c5d1c2575d3b75).(qh, facet);
639 tempcentrum= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
640 }
641 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facet) {
642 if (neighbor->simplicialcxx . . $ facetT#simplicial. && tested_simplicial) /* tested above since f.simplicial */
643 continue;
644 if (neighbor->tricoplanarcxx . . $ facetT#tricoplanar.)
645 continue;
646 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zdistconvex);
647 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, centrum, neighbor, &dist);
648 if (dist > qh->DISTroundcxx . . $ qhT#DISTround.) {
649 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zconcaveridges);
650 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "concave ridge");
651 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6117, "qhull precision error: f%d is concave to f%d. Centrum of f%d is %6.4g above f%d\n",
652 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., facet->idcxx . . $ facetT#id., dist, neighbor->idcxx . . $ facetT#id.);
653 errfacet1= facet;
654 errfacet2= neighbor;
655 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
656 }else if (dist >= 0.0) { /* if arithmetic always rounds the same,
657 can test against centrum radius instead */
658 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zcoplanarridges);
659 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "coplanar ridge");
660 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6118, "qhull precision error: f%d is coplanar or concave to f%d. Centrum of f%d is %6.4g above f%d\n",
661 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., facet->idcxx . . $ facetT#id., dist, neighbor->idcxx . . $ facetT#id.);
662 errfacet1= facet;
663 errfacet2= neighbor;
664 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
665 }
666 }
667 if (tempcentrum)
668 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, centrum, qh->normal_sizecxx . . $ qhT#normal_size.);
669 }
670 }
671 if (waserror && !qh->FORCEoutputcxx . . $ qhT#FORCEoutput.)
672 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!, errfacet1, errfacet2);
673 } /* checkconvex */
674
675
676 /*-<a href="qh-poly_r.htm#TOC"
677 >-------------------------------</a><a name="checkfacet">-</a>
678
679 qh_checkfacet(qh, facet, newmerge, waserror )
680 checks for consistency errors in facet
681 newmerge set if from merge_r.c
682
683 returns:
684 sets waserror if any error occurs
685
686 checks:
687 vertex ids are inverse sorted
688 unless newmerge, at least hull_dim neighbors and vertices (exactly if simplicial)
689 if non-simplicial, at least as many ridges as neighbors
690 neighbors are not duplicated
691 ridges are not duplicated
692 in 3-d, ridges=verticies
693 (qh.hull_dim-1) ridge vertices
694 neighbors are reciprocated
695 ridge neighbors are facet neighbors and a ridge for every neighbor
696 simplicial neighbors match facetintersect
697 vertex intersection matches vertices of common ridges
698 vertex neighbors and facet vertices agree
699 all ridges have distinct vertex sets
700
701 notes:
702 called by qh_tracemerge and qh_checkpolygon
703 uses neighbor->seen
704
705 design:
706 check sets
707 check vertices
708 check sizes of neighbors and vertices
709 check for qh_MERGEridge and qh_DUPLICATEridge flags
710 check neighbor set
711 check ridge set
712 check ridges, neighbors, and vertices
713 */
714 void qh_checkfacetcxx . . $ qh_checkfacet(79503c1aba116d05).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! newmerge, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! *waserrorp) {
715 facetTcxx . . $ facetT# *neighbor, **neighborp, *errother=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
716 ridgeTcxx . . $ ridgeT# *ridge, **ridgep, *errridge= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *ridge2;
717 vertexTcxx . . $ vertexT# *vertex, **vertexp;
718 unsigned int previousid= INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`!;
719 int numneighbors, numvertices, numridges=0, numRvertices=0;
720 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
721 int skipA, skipB, ridge_i, ridge_n, i, last_v= qh->hull_dimcxx . . $ qhT#hull_dim.-2;
722 setTcxx . . $ setT# *intersection;
723
724 trace4cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:91:9`!((qh, qh->ferr, 4088, "qh_checkfacet: check f%d newmerge? %d\n", facet->id, newmerge));
725 if (facet->idcxx . . $ facetT#id. >= qh->facet_idcxx . . $ qhT#facet_id.) {
726 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6414, "qhull internal error (qh_checkfacet): unknown facet id f%d >= qh.facet_id (%d)\n", facet->idcxx . . $ facetT#id., qh->facet_idcxx . . $ qhT#facet_id.);
727 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
728 }
729 if (facet->visitidcxx . . $ facetT#visitid. > qh->visit_idcxx . . $ qhT#visit_id.) {
730 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6415, "qhull internal error (qh_checkfacet): expecting f%d.visitid <= qh.visit_id (%d). Got visitid %d\n", facet->idcxx . . $ facetT#id., qh->visit_idcxx . . $ qhT#visit_id., facet->visitidcxx . . $ facetT#visitid.);
731 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
732 }
733 if (facet->visiblecxx . . $ facetT#visible. && !qh->NEWtentativecxx . . $ qhT#NEWtentative.) {
734 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6119, "qhull internal error (qh_checkfacet): facet f%d is on qh.visible_list\n",
735 facet->idcxx . . $ facetT#id.);
736 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
737 }
738 if (facet->redundantcxx . . $ facetT#redundant. && !facet->visiblecxx . . $ facetT#visible. && qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->degen_mergesetcxx . . $ qhT#degen_mergeset.)==0) {
739 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6399, "qhull internal error (qh_checkfacet): redundant facet f%d not on qh.visible_list\n",
740 facet->idcxx . . $ facetT#id.);
741 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
742 }
743 if (facet->degeneratecxx . . $ facetT#degenerate. && !facet->visiblecxx . . $ facetT#visible. && qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->degen_mergesetcxx . . $ qhT#degen_mergeset.)==0) {
744 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6400, "qhull internal error (qh_checkfacet): degenerate facet f%d is not on qh.visible_list and qh.degen_mergeset is empty\n",
745 facet->idcxx . . $ facetT#id.);
746 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
747 }
748 if (!facet->normalcxx . . $ facetT#normal.) {
749 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6120, "qhull internal error (qh_checkfacet): facet f%d does not have a normal\n",
750 facet->idcxx . . $ facetT#id.);
751 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
752 }
753 if (!facet->newfacetcxx . . $ facetT#newfacet.) {
754 if (facet->dupridgecxx . . $ facetT#dupridge.) {
755 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6349, "qhull internal error (qh_checkfacet): f%d is 'dupridge' but it is not a newfacet on qh.newfacet_list f%d\n",
756 facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newfacet_list));
757 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
758 }
759 if (facet->newmergecxx . . $ facetT#newmerge.) {
760 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6383, "qhull internal error (qh_checkfacet): f%d is 'newmerge' but it is not a newfacet on qh.newfacet_list f%d. Missing call to qh_reducevertices\n",
761 facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newfacet_list));
762 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
763 }
764 }
765 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, facet->verticescxx . . $ facetT#vertices., "vertices for f", facet->idcxx . . $ facetT#id.);
766 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, facet->ridgescxx . . $ facetT#ridges., "ridges for f", facet->idcxx . . $ facetT#id.);
767 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, facet->outsidesetcxx . . $ facetT#outsideset., "outsideset for f", facet->idcxx . . $ facetT#id.);
768 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, facet->coplanarsetcxx . . $ facetT#coplanarset., "coplanarset for f", facet->idcxx . . $ facetT#id.);
769 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, facet->neighborscxx . . $ facetT#neighbors., "neighbors for f", facet->idcxx . . $ facetT#id.);
770 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices) {
771 if (vertex->deletedcxx . . $ vertexT#deleted.) {
772 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6121, "qhull internal error (qh_checkfacet): deleted vertex v%d in f%d\n", vertex->idcxx . . $ vertexT#id., facet->idcxx . . $ facetT#id.);
773 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, vertex);
774 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
775 }
776 if (vertex->idcxx . . $ vertexT#id. >= previousid) {
777 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6122, "qhull internal error (qh_checkfacet): vertices of f%d are not in descending id order at v%d\n", facet->idcxx . . $ facetT#id., vertex->idcxx . . $ vertexT#id.);
778 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
779 break;
780 }
781 previousid= vertex->idcxx . . $ vertexT#id.;
782 }
783 numneighbors= qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->neighborscxx . . $ facetT#neighbors.);
784 numvertices= qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->verticescxx . . $ facetT#vertices.);
785 numridges= qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->ridgescxx . . $ facetT#ridges.);
786 if (facet->simplicialcxx . . $ facetT#simplicial.) {
787 if (numvertices+numneighbors != 2*qh->hull_dimcxx . . $ qhT#hull_dim.
788 && !facet->degeneratecxx . . $ facetT#degenerate. && !facet->redundantcxx . . $ facetT#redundant.) {
789 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6123, "qhull internal error (qh_checkfacet): for simplicial facet f%d, #vertices %d + #neighbors %d != 2*qh->hull_dim\n",
790 facet->idcxx . . $ facetT#id., numvertices, numneighbors);
791 qh_setprintcxx . . $ qh_setprint(8d7a4f12658461cd).(qh, qh->ferrcxx . . $ qhT#ferr., "", facet->neighborscxx . . $ facetT#neighbors.);
792 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
793 }
794 }else { /* non-simplicial */
795 if (!newmerge
796 &&(numvertices < qh->hull_dimcxx . . $ qhT#hull_dim. || numneighbors < qh->hull_dimcxx . . $ qhT#hull_dim.)
797 && !facet->degeneratecxx . . $ facetT#degenerate. && !facet->redundantcxx . . $ facetT#redundant.) {
798 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6124, "qhull internal error (qh_checkfacet): for facet f%d, #vertices %d or #neighbors %d < qh->hull_dim\n",
799 facet->idcxx . . $ facetT#id., numvertices, numneighbors);
800 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
801 }
802 /* in 3-d, can get a vertex twice in an edge list, e.g., RBOX 1000 s W1e-13 t995849315 D2 | QHULL d Tc Tv TP624 TW1e-13 T4 */
803 if (numridges < numneighbors
804 ||(qh->hull_dimcxx . . $ qhT#hull_dim. == 3 && numvertices > numridges && !qh->NEWfacetscxx . . $ qhT#NEWfacets.)
805 ||(qh->hull_dimcxx . . $ qhT#hull_dim. == 2 && numridges + numvertices + numneighbors != 6)) {
806 if (!facet->degeneratecxx . . $ facetT#degenerate. && !facet->redundantcxx . . $ facetT#redundant.) {
807 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6125, "qhull internal error (qh_checkfacet): for facet f%d, #ridges %d < #neighbors %d or(3-d) > #vertices %d or(2-d) not all 2\n",
808 facet->idcxx . . $ facetT#id., numridges, numneighbors, numvertices);
809 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
810 }
811 }
812 }
813 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facet) {
814 if (neighbor == qh_MERGEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:58:9`! || neighbor == qh_DUPLICATEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:46:9`!) {
815 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6126, "qhull internal error (qh_checkfacet): facet f%d still has a MERGEridge or DUPLICATEridge neighbor\n", facet->idcxx . . $ facetT#id.);
816 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
817 }
818 if (neighbor->visiblecxx . . $ facetT#visible.) {
819 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6401, "qhull internal error (qh_checkfacet): facet f%d has deleted neighbor f%d (qh.visible_list)\n",
820 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id.);
821 errother= neighbor;
822 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
823 }
824 neighbor->seencxx . . $ facetT#seen.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
825 }
826 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facet) {
827 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(neighbor->neighborscxx . . $ facetT#neighbors., facet)) {
828 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6127, "qhull internal error (qh_checkfacet): facet f%d has neighbor f%d, but f%d does not have neighbor f%d\n",
829 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., facet->idcxx . . $ facetT#id.);
830 errother= neighbor;
831 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
832 }
833 if (!neighbor->seencxx . . $ facetT#seen.) {
834 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6128, "qhull internal error (qh_checkfacet): facet f%d has a duplicate neighbor f%d\n",
835 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id.);
836 errother= neighbor;
837 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
838 }
839 neighbor->seencxx . . $ facetT#seen.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
840 }
841 FOREACHridge_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1032:9`!(facet->ridges) {
842 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, ridge->verticescxx . . $ ridgeT#vertices., "vertices for r", ridge->idcxx . . $ ridgeT#id.);
843 ridge->seencxx . . $ ridgeT#seen.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
844 }
845 FOREACHridge_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1032:9`!(facet->ridges) {
846 if (ridge->seencxx . . $ ridgeT#seen.) {
847 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6129, "qhull internal error (qh_checkfacet): facet f%d has a duplicate ridge r%d\n",
848 facet->idcxx . . $ facetT#id., ridge->idcxx . . $ ridgeT#id.);
849 errridge= ridge;
850 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
851 }
852 ridge->seencxx . . $ ridgeT#seen.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
853 numRvertices= qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, ridge->verticescxx . . $ ridgeT#vertices.);
854 if (numRvertices != qh->hull_dimcxx . . $ qhT#hull_dim. - 1) {
855 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6130, "qhull internal error (qh_checkfacet): ridge between f%d and f%d has %d vertices\n",
856 ridge->topcxx . . $ ridgeT#top.->idcxx . . $ facetT#id., ridge->bottomcxx . . $ ridgeT#bottom.->idcxx . . $ facetT#id., numRvertices);
857 errridge= ridge;
858 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
859 }
860 neighbor= otherfacet_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:891:9`!(ridge, facet);
861 neighbor->seencxx . . $ facetT#seen.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
862 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(facet->neighborscxx . . $ facetT#neighbors., neighbor)) {
863 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6131, "qhull internal error (qh_checkfacet): for facet f%d, neighbor f%d of ridge r%d not in facet\n",
864 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., ridge->idcxx . . $ ridgeT#id.);
865 errridge= ridge;
866 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
867 }
868 if (!facet->newfacetcxx . . $ facetT#newfacet. && !neighbor->newfacetcxx . . $ facetT#newfacet.) {
869 if ((!ridge->testedcxx . . $ ridgeT#tested.) | ridge->nonconvexcxx . . $ ridgeT#nonconvex. | ridge->mergevertexcxx . . $ ridgeT#mergevertex.) {
870 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6384, "qhull internal error (qh_checkfacet): ridge r%d is nonconvex (%d), mergevertex (%d) or not tested (%d) for facet f%d, neighbor f%d\n",
871 ridge->idcxx . . $ ridgeT#id., ridge->nonconvexcxx . . $ ridgeT#nonconvex., ridge->mergevertexcxx . . $ ridgeT#mergevertex., ridge->testedcxx . . $ ridgeT#tested., facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id.);
872 errridge= ridge;
873 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
874 }
875 }
876 }
877 if (!facet->simplicialcxx . . $ facetT#simplicial.) {
878 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facet) {
879 if (!neighbor->seencxx . . $ facetT#seen.) {
880 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6132, "qhull internal error (qh_checkfacet): facet f%d does not have a ridge for neighbor f%d\n",
881 facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id.);
882 errother= neighbor;
883 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
884 }
885 intersection= qh_vertexintersect_newcxx . . $ qh_vertexintersect_new(32b2859603312e85).(qh, facet->verticescxx . . $ facetT#vertices., neighbor->verticescxx . . $ facetT#vertices.);
886 qh_settemppushcxx . . $ qh_settemppush(8608e985da769b75).(qh, intersection);
887 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices) {
888 vertex->seencxx . . $ vertexT#seen.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
889 vertex->seen2cxx . . $ vertexT#seen2.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
890 }
891 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(intersection)
892 vertex->seencxx . . $ vertexT#seen.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
893 FOREACHridge_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1032:9`!(facet->ridges) {
894 if (neighbor != otherfacet_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:891:9`!(ridge, facet))
895 continue;
896 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(ridge->vertices) {
897 if (!vertex->seencxx . . $ vertexT#seen.) {
898 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6133, "qhull internal error (qh_checkfacet): vertex v%d in r%d not in f%d intersect f%d\n",
899 vertex->idcxx . . $ vertexT#id., ridge->idcxx . . $ ridgeT#id., facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id.);
900 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, ridge);
901 }
902 vertex->seen2cxx . . $ vertexT#seen2.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
903 }
904 }
905 if (!newmerge) {
906 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(intersection) {
907 if (!vertex->seen2cxx . . $ vertexT#seen2.) {
908 if (!qh->MERGINGcxx . . $ qhT#MERGING.) {
909 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6420, "qhull topology error (qh_checkfacet): vertex v%d in f%d intersect f%d but not in a ridge. Last point was p%d\n",
910 vertex->idcxx . . $ vertexT#id., facet->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id., qh->furthest_idcxx . . $ qhT#furthest_id.);
911 if (!qh->FORCEoutputcxx . . $ qhT#FORCEoutput.) {
912 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", facet, neighbor, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, vertex);
913 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRtopologycxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:209:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
914 }
915 }else {
916 trace4cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:91:9`!((qh, qh->ferr, 4025, "qh_checkfacet: vertex v%d in f%d intersect f%d but not in a ridge. Repaired by qh_remove_extravertices in qh_reducevertices\n",
917 vertex->id, facet->id, neighbor->id));
918 }
919 }
920 }
921 }
922 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &intersection);
923 }
924 }else { /* simplicial */
925 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facet) {
926 if (neighbor->simplicialcxx . . $ facetT#simplicial. && !facet->degeneratecxx . . $ facetT#degenerate. && !neighbor->degeneratecxx . . $ facetT#degenerate.) {
927 skipA= SETindex_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:324:9`!(facet->neighbors, neighbor);
928 skipB= qh_setindexcxx . . $ qh_setindex(1cb32c02d661274).(neighbor->neighborscxx . . $ facetT#neighbors., facet);
929 if (skipA<0 || skipB<0 || !qh_setequal_skipcxx . . $ qh_setequal_skip(b3f63bd3cf74acc2).(facet->verticescxx . . $ facetT#vertices., skipA, neighbor->verticescxx . . $ facetT#vertices., skipB)) {
930 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6135, "qhull internal error (qh_checkfacet): facet f%d skip %d and neighbor f%d skip %d do not match \n",
931 facet->idcxx . . $ facetT#id., skipA, neighbor->idcxx . . $ facetT#id., skipB);
932 errother= neighbor;
933 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
934 }
935 }
936 }
937 }
938 if (!newmerge && qh->CHECKduplicatescxx . . $ qhT#CHECKduplicates. && qh->hull_dimcxx . . $ qhT#hull_dim. < 5 && (qh->IStracingcxx . . $ qhT#IStracing. > 2 || qh->CHECKfrequentlycxx . . $ qhT#CHECKfrequently.)) {
939 FOREACHridge_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1110:9`!(qh, facet->ridges) { /* expensive, if was merge and qh_maybe_duplicateridges hasn't been called yet */
940 if (!ridge->mergevertexcxx . . $ ridgeT#mergevertex.) {
941 for (i=ridge_i+1; i < ridge_n; i++) {
942 ridge2= SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(facet->ridges, i, ridgeT);
943 if (SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(ridge->vertices, last_v) == SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(ridge2->vertices, last_v)) { /* SETfirst is likely to be the same */
944 if (SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(ridge->vertices) == SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(ridge2->vertices)) {
945 if (qh_setequalcxx . . $ qh_setequal(6f841020c30f50ac).(ridge->verticescxx . . $ ridgeT#vertices., ridge2->verticescxx . . $ ridgeT#vertices.)) {
946 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6294, "qhull internal error (qh_checkfacet): ridges r%d and r%d (f%d) have the same vertices\n", /* same as duplicate ridge */
947 ridge->idcxx . . $ ridgeT#id., ridge2->idcxx . . $ ridgeT#id., facet->idcxx . . $ facetT#id.);
948 errridge= ridge;
949 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
950 }
951 }
952 }
953 }
954 }
955 }
956 }
957 if (waserror) {
958 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", facet, errother, errridge, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
959 *waserrorp= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
960 }
961 } /* checkfacet */
962
963 /*-<a href="qh-poly_r.htm#TOC"
964 >-------------------------------</a><a name="checkflipped_all">-</a>
965
966 qh_checkflipped_all(qh, facetlist )
967 checks orientation of facets in list against interior point
968
969 notes:
970 called by qh_checkoutput
971 */
972 void qh_checkflipped_allcxx . . $ qh_checkflipped_all(6436bdf99f629b76).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist) {
973 facetTcxx . . $ facetT# *facet;
974 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
975 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist;
976
977 if (facetlist == qh->facet_listcxx . . $ qhT#facet_list.)
978 zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Zflippedfacets)= 0;
979 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
980 if (facet->normalcxx . . $ facetT#normal. && !qh_checkflippedcxx . . $ qh_checkflipped(e8493651136531c1).(qh, facet, &dist, !qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!)) {
981 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6136, "qhull precision error: facet f%d is flipped, distance= %6.12g\n",
982 facet->idcxx . . $ facetT#id., dist);
983 if (!qh->FORCEoutputcxx . . $ qhT#FORCEoutput.) {
984 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
985 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
986 }
987 }
988 }
989 if (waserror) {
990 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8101, "\n\
991 A flipped facet occurs when its distance to the interior point is\n\
992 greater than or equal to %2.2g, the maximum roundoff error.\n", -qh->DISTroundcxx . . $ qhT#DISTround.);
993 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
994 }
995 } /* checkflipped_all */
996
997 /*-<a href="qh-poly_r.htm#TOC"
998 >-------------------------------</a><a name="checklists">-</a>
999
1000 qh_checklists(qh, facetlist )
1001 Check and repair facetlist and qh.vertex_list for infinite loops or overwritten facets
1002 Checks that qh.newvertex_list is on qh.vertex_list
1003 if facetlist is qh.facet_list
1004 Checks that qh.visible_list and qh.newfacet_list are on qh.facet_list
1005 Updates qh.facetvisit and qh.vertexvisit
1006
1007 returns:
1008 True if no errors found
1009 If false, repairs erroneous lists to prevent infinite loops by FORALL macros
1010
1011 notes:
1012 called by qh_buildtracing, qh_checkpolygon, qh_collectstatistics, qh_printfacetlist, qh_printsummary
1013 not called by qh_printlists
1014
1015 design:
1016 if facetlist
1017 check qh.facet_tail
1018 for each facet
1019 check for infinite loop or overwritten facet
1020 check previous facet
1021 if facetlist is qh.facet_list
1022 check qh.next_facet, qh.visible_list and qh.newfacet_list
1023 if vertexlist
1024 check qh.vertex_tail
1025 for each vertex
1026 check for infinite loop or overwritten vertex
1027 check previous vertex
1028 check qh.newvertex_list
1029 */
1030 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! qh_checklistscxx . . $ qh_checklists(c5e9f8858b71e4e4).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist) {
1031 facetTcxx . . $ facetT# *facet, *errorfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *errorfacet2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *previousfacet;
1032 vertexTcxx . . $ vertexT# *vertex, *vertexlist, *previousvertex, *errorvertex= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1033 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, newseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, nextseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, newvertexseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, visibleseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1034
1035 if (facetlist == qh->newfacet_listcxx . . $ qhT#newfacet_list. || facetlist == qh->visible_listcxx . . $ qhT#visible_list.) {
1036 vertexlist= qh->vertex_listcxx . . $ qhT#vertex_list.;
1037 previousvertex= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1038 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2110, "qh_checklists: check qh.%s_list f%d and qh.vertex_list v%d\n",
1039 (facetlist == qh->newfacet_list ? "newfacet" : "visible"), facetlist->id, getid_(vertexlist)));
1040 }else {
1041 vertexlist= qh->vertex_listcxx . . $ qhT#vertex_list.;
1042 previousvertex= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1043 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2111, "qh_checklists: check %slist f%d and qh.vertex_list v%d\n",
1044 (facetlist == qh->facet_list ? "qh.facet_" : "facet"), getid_(facetlist), getid_(vertexlist)));
1045 }
1046 if (facetlist) {
1047 if (qh->facet_tailcxx . . $ qhT#facet_tail. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || qh->facet_tailcxx . . $ qhT#facet_tail.->idcxx . . $ facetT#id. != 0 || qh->facet_tailcxx . . $ qhT#facet_tail.->nextcxx . . $ facetT#next. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
1048 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6397, "qhull internal error (qh_checklists): either qh.facet_tail f%d is NULL, or its id is not 0, or its next is not NULL\n",
1049 getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->facet_tail));
1050 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, qh->facet_tailcxx . . $ qhT#facet_tail., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1051 }
1052 previousfacet= (facetlist == qh->facet_listcxx . . $ qhT#facet_list. ? NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! : facetlist->previouscxx . . $ facetT#previous.);
1053 qh->visit_idcxx . . $ qhT#visit_id.++;
1054 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1055 if (facet->visitidcxx . . $ facetT#visitid. >= qh->visit_idcxx . . $ qhT#visit_id. || facet->idcxx . . $ facetT#id. >= qh->facet_idcxx . . $ qhT#facet_id.) {
1056 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1057 errorfacet= facet;
1058 errorfacet2= previousfacet;
1059 if (facet->visitidcxx . . $ facetT#visitid. == qh->visit_idcxx . . $ qhT#visit_id.)
1060 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6039, "qhull internal error (qh_checklists): f%d already in facetlist causing an infinite loop ... f%d > f%d ... > f%d > f%d. Truncate facetlist at f%d\n",
1061 facet->idcxx . . $ facetT#id., facet->idcxx . . $ facetT#id., facet->nextcxx . . $ facetT#next.->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousfacet), facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousfacet));
1062 else
1063 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6350, "qhull internal error (qh_checklists): unknown or overwritten facet f%d, either id >= qh.facet_id (%d) or f.visitid %u > qh.visit_id %u. Facetlist terminated at previous facet f%d\n",
1064 facet->idcxx . . $ facetT#id., qh->facet_idcxx . . $ qhT#facet_id., facet->visitidcxx . . $ facetT#visitid., qh->visit_idcxx . . $ qhT#visit_id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousfacet));
1065 if (previousfacet)
1066 previousfacet->nextcxx . . $ facetT#next.= qh->facet_tailcxx . . $ qhT#facet_tail.;
1067 else
1068 facetlist= qh->facet_tailcxx . . $ qhT#facet_tail.;
1069 break;
1070 }
1071 facet->visitidcxx . . $ facetT#visitid.= qh->visit_idcxx . . $ qhT#visit_id.;
1072 if (facet->previouscxx . . $ facetT#previous. != previousfacet) {
1073 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6416, "qhull internal error (qh_checklists): expecting f%d.previous == f%d. Got f%d\n",
1074 facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousfacet), getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(facet->previous));
1075 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1076 errorfacet= facet;
1077 errorfacet2= facet->previouscxx . . $ facetT#previous.;
1078 }
1079 previousfacet= facet;
1080 if (facetlist == qh->facet_listcxx . . $ qhT#facet_list.) {
1081 if (facet == qh->visible_listcxx . . $ qhT#visible_list.) {
1082 if(newseen){
1083 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6285, "qhull internal error (qh_checklists): qh.visible_list f%d is after qh.newfacet_list f%d. It should be at, before, or NULL\n",
1084 facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newfacet_list));
1085 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1086 errorfacet= facet;
1087 errorfacet2= qh->newfacet_listcxx . . $ qhT#newfacet_list.;
1088 }
1089 visibleseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1090 }
1091 if (facet == qh->newfacet_listcxx . . $ qhT#newfacet_list.)
1092 newseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1093 if (facet == qh->facet_nextcxx . . $ qhT#facet_next.)
1094 nextseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1095 }
1096 }
1097 if (facetlist == qh->facet_listcxx . . $ qhT#facet_list.) {
1098 if (!nextseen && qh->facet_nextcxx . . $ qhT#facet_next. && qh->facet_nextcxx . . $ qhT#facet_next.->nextcxx . . $ facetT#next.) {
1099 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6369, "qhull internal error (qh_checklists): qh.facet_next f%d for qh_addpoint is not on qh.facet_list f%d\n",
1100 qh->facet_nextcxx . . $ qhT#facet_next.->idcxx . . $ facetT#id., facetlist->idcxx . . $ facetT#id.);
1101 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1102 errorfacet= qh->facet_nextcxx . . $ qhT#facet_next.;
1103 errorfacet2= facetlist;
1104 }
1105 if (!newseen && qh->newfacet_listcxx . . $ qhT#newfacet_list. && qh->newfacet_listcxx . . $ qhT#newfacet_list.->nextcxx . . $ facetT#next.) {
1106 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6286, "qhull internal error (qh_checklists): qh.newfacet_list f%d is not on qh.facet_list f%d\n",
1107 qh->newfacet_listcxx . . $ qhT#newfacet_list.->idcxx . . $ facetT#id., facetlist->idcxx . . $ facetT#id.);
1108 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1109 errorfacet= qh->newfacet_listcxx . . $ qhT#newfacet_list.;
1110 errorfacet2= facetlist;
1111 }
1112 if (!visibleseen && qh->visible_listcxx . . $ qhT#visible_list. && qh->visible_listcxx . . $ qhT#visible_list.->nextcxx . . $ facetT#next.) {
1113 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6138, "qhull internal error (qh_checklists): qh.visible_list f%d is not on qh.facet_list f%d\n",
1114 qh->visible_listcxx . . $ qhT#visible_list.->idcxx . . $ facetT#id., facetlist->idcxx . . $ facetT#id.);
1115 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1116 errorfacet= qh->visible_listcxx . . $ qhT#visible_list.;
1117 errorfacet2= facetlist;
1118 }
1119 }
1120 }
1121 if (vertexlist) {
1122 if (qh->vertex_tailcxx . . $ qhT#vertex_tail. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || qh->vertex_tailcxx . . $ qhT#vertex_tail.->idcxx . . $ vertexT#id. != 0 || qh->vertex_tailcxx . . $ qhT#vertex_tail.->nextcxx . . $ vertexT#next. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
1123 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6366, "qhull internal error (qh_checklists): either qh.vertex_tail v%d is NULL, or its id is not 0, or its next is not NULL\n",
1124 getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->vertex_tail));
1125 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", errorfacet, errorfacet2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, qh->vertex_tailcxx . . $ qhT#vertex_tail.);
1126 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1127 }
1128 qh->vertex_visitcxx . . $ qhT#vertex_visit.++;
1129 FORALLvertex_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:102:9`!(vertexlist) {
1130 if (vertex->visitidcxx . . $ vertexT#visitid. >= qh->vertex_visitcxx . . $ qhT#vertex_visit. || vertex->idcxx . . $ vertexT#id. >= qh->vertex_idcxx . . $ qhT#vertex_id.) {
1131 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1132 errorvertex= vertex;
1133 if (vertex->visitidcxx . . $ vertexT#visitid. == qh->visit_idcxx . . $ qhT#visit_id.)
1134 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6367, "qhull internal error (qh_checklists): v%d already in vertexlist causing an infinite loop ... v%d > v%d ... > v%d > v%d. Truncate vertexlist at v%d\n",
1135 vertex->idcxx . . $ vertexT#id., vertex->idcxx . . $ vertexT#id., vertex->nextcxx . . $ vertexT#next.->idcxx . . $ vertexT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousvertex), vertex->idcxx . . $ vertexT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousvertex));
1136 else
1137 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6368, "qhull internal error (qh_checklists): unknown or overwritten vertex v%d, either id >= qh.vertex_id (%d) or v.visitid %u > qh.visit_id %u. vertexlist terminated at previous vertex v%d\n",
1138 vertex->idcxx . . $ vertexT#id., qh->vertex_idcxx . . $ qhT#vertex_id., vertex->visitidcxx . . $ vertexT#visitid., qh->visit_idcxx . . $ qhT#visit_id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousvertex));
1139 if (previousvertex)
1140 previousvertex->nextcxx . . $ vertexT#next.= qh->vertex_tailcxx . . $ qhT#vertex_tail.;
1141 else
1142 vertexlist= qh->vertex_tailcxx . . $ qhT#vertex_tail.;
1143 break;
1144 }
1145 vertex->visitidcxx . . $ vertexT#visitid.= qh->vertex_visitcxx . . $ qhT#vertex_visit.;
1146 if (vertex->previouscxx . . $ vertexT#previous. != previousvertex) {
1147 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6427, "qhull internal error (qh_checklists): expecting v%d.previous == v%d. Got v%d\n",
1148 vertex->idcxx . . $ vertexT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(previousvertex), getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(vertex->previous));
1149 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1150 errorvertex= vertex;
1151 }
1152 previousvertex= vertex;
1153 if(vertex == qh->newvertex_listcxx . . $ qhT#newvertex_list.)
1154 newvertexseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1155 }
1156 if(!newvertexseen && qh->newvertex_listcxx . . $ qhT#newvertex_list. && qh->newvertex_listcxx . . $ qhT#newvertex_list.->nextcxx . . $ vertexT#next.) {
1157 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6287, "qhull internal error (qh_checklists): new vertex list v%d is not on vertex list\n", qh->newvertex_listcxx . . $ qhT#newvertex_list.->idcxx . . $ vertexT#id.);
1158 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1159 errorvertex= qh->newvertex_listcxx . . $ qhT#newvertex_list.;
1160 }
1161 }
1162 if (waserror) {
1163 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", errorfacet, errorfacet2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, errorvertex);
1164 return Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1165 }
1166 return Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1167 } /* checklists */
1168
1169 /*-<a href="qh-poly_r.htm#TOC"
1170 >-------------------------------</a><a name="checkpolygon">-</a>
1171
1172 qh_checkpolygon(qh, facetlist )
1173 checks the correctness of the structure
1174
1175 notes:
1176 called by qh_addpoint, qh_all_vertexmerge, qh_check_output, qh_initialhull, qh_prepare_output, qh_triangulate
1177 call with qh.facet_list or qh.newfacet_list or another list
1178 checks num_facets and num_vertices if qh.facet_list
1179
1180 design:
1181 check and repair lists for infinite loop
1182 for each facet
1183 check f.newfacet and f.visible
1184 check facet and outside set if qh.NEWtentative and not f.newfacet, or not f.visible
1185 initializes vertexlist for qh.facet_list or qh.newfacet_list
1186 for each vertex
1187 check vertex
1188 check v.newfacet
1189 for each facet
1190 count f.ridges
1191 check and count f.vertices
1192 if checking qh.facet_list
1193 check facet count
1194 if qh.VERTEXneighbors
1195 check and count v.neighbors for all vertices
1196 check v.neighbors count and report possible causes of mismatch
1197 check that facets are in their v.neighbors
1198 check vertex count
1199 */
1200 void qh_checkpolygoncxx . . $ qh_checkpolygon(6436bdf99f629b76).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist) {
1201 facetTcxx . . $ facetT# *facet, *neighbor, **neighborp;
1202 facetTcxx . . $ facetT# *errorfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *errorfacet2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1203 vertexTcxx . . $ vertexT# *vertex, **vertexp, *vertexlist;
1204 int numfacets= 0, numvertices= 0, numridges= 0;
1205 int totvneighbors= 0, totfacetvertices= 0;
1206 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, newseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, newvertexseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, nextseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, visibleseen= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1207 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! checkfacet;
1208
1209 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1027, "qh_checkpolygon: check all facets from f%d, qh.NEWtentative? %d\n", facetlist->id, qh->NEWtentative));
1210 if (!qh_checklistscxx . . $ qh_checklists(c5e9f8858b71e4e4).(qh, facetlist)) {
1211 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1212 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6374, "qhull internal error: qh_checklists failed in qh_checkpolygon\n");
1213 if (qh->num_facetscxx . . $ qhT#num_facets. < 4000)
1214 qh_printlistscxx . . $ qh_printlists(fb32973c8cc8eae9).(qh);
1215 }
1216 if (facetlist != qh->facet_listcxx . . $ qhT#facet_list. || qh->ONLYgoodcxx . . $ qhT#ONLYgood.)
1217 nextseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!; /* allow f.outsideset */
1218 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1219 if (facet == qh->visible_listcxx . . $ qhT#visible_list.)
1220 visibleseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1221 if (facet == qh->newfacet_listcxx . . $ qhT#newfacet_list.)
1222 newseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1223 if (facet->newfacetcxx . . $ facetT#newfacet. && !newseen && !visibleseen) {
1224 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6289, "qhull internal error (qh_checkpolygon): f%d is 'newfacet' but it is not on qh.newfacet_list f%d or visible_list f%d\n", facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newfacet_list), getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->visible_list));
1225 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1226 }
1227 if (!facet->newfacetcxx . . $ facetT#newfacet. && newseen) {
1228 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6292, "qhull internal error (qh_checkpolygon): f%d is on qh.newfacet_list f%d but it is not 'newfacet'\n", facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newfacet_list));
1229 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1230 }
1231 if (facet->visiblecxx . . $ facetT#visible. != (visibleseen & !newseen)) {
1232 if(facet->visiblecxx . . $ facetT#visible.)
1233 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6290, "qhull internal error (qh_checkpolygon): f%d is 'visible' but it is not on qh.visible_list f%d\n", facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->visible_list));
1234 else
1235 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6291, "qhull internal error (qh_checkpolygon): f%d is on qh.visible_list f%d but it is not 'visible'\n", facet->idcxx . . $ facetT#id., qh->newfacet_listcxx . . $ qhT#newfacet_list.->idcxx . . $ facetT#id.);
1236 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1237 }
1238 if (qh->NEWtentativecxx . . $ qhT#NEWtentative.) {
1239 checkfacet= !facet->newfacetcxx . . $ facetT#newfacet.;
1240 }else {
1241 checkfacet= !facet->visiblecxx . . $ facetT#visible.;
1242 }
1243 if(checkfacet) {
1244 if (!nextseen) {
1245 if (facet == qh->facet_nextcxx . . $ qhT#facet_next.) /* previous facets do not have outsideset */
1246 nextseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1247 else if (qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->outsidesetcxx . . $ facetT#outsideset.)) {
1248 if (!qh->NARROWhullcxx . . $ qhT#NARROWhull.
1249 #if !qh_COMPUTEfurthestcxx . . $ `vendor/qhull/libqhull_r/user_r.h:565:9`!
1250 || facet->furthestdistcxx . . $ facetT#furthestdist. >= qh->MINoutsidecxx . . $ qhT#MINoutside.
1251 #endif
1252 ) {
1253 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6137, "qhull internal error (qh_checkpolygon): f%d has outside points before qh.facet_next f%d\n",
1254 facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->facet_next));
1255 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, qh->facet_nextcxx . . $ qhT#facet_next.);
1256 }
1257 }
1258 }
1259 numfacets++;
1260 qh_checkfacetcxx . . $ qh_checkfacet(79503c1aba116d05).(qh, facet, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, &waserror);
1261 }else if (facet->visiblecxx . . $ facetT#visible. && qh->NEWfacetscxx . . $ qhT#NEWfacets.) {
1262 if (!SETempty_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:436:9`!(facet->neighbors) || !SETempty_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:436:9`!(facet->ridges)) {
1263 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6376, "qhull internal error (qh_checkpolygon): expecting empty f.neighbors and f.ridges for visible facet f%d. Got %d neighbors and %d ridges\n",
1264 facet->idcxx . . $ facetT#id., qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->neighborscxx . . $ facetT#neighbors.), qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->ridgescxx . . $ facetT#ridges.));
1265 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1266 }
1267 }
1268 }
1269 if (facetlist == qh->facet_listcxx . . $ qhT#facet_list.) {
1270 vertexlist= qh->vertex_listcxx . . $ qhT#vertex_list.;
1271 }else if (facetlist == qh->newfacet_listcxx . . $ qhT#newfacet_list.) {
1272 vertexlist= qh->newvertex_listcxx . . $ qhT#newvertex_list.;
1273 }else {
1274 vertexlist= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1275 }
1276 FORALLvertex_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:102:9`!(vertexlist) {
1277 qh_checkvertexcxx . . $ qh_checkvertex(e87e7017dd93a6fb).(qh, vertex, !qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!, &waserror);
1278 if(vertex == qh->newvertex_listcxx . . $ qhT#newvertex_list.)
1279 newvertexseen= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1280 vertex->seencxx . . $ vertexT#seen.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1281 vertex->visitidcxx . . $ vertexT#visitid.= 0;
1282 if(vertex->newfacetcxx . . $ vertexT#newfacet. && !newvertexseen && !vertex->deletedcxx . . $ vertexT#deleted.) {
1283 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6288, "qhull internal error (qh_checkpolygon): v%d is 'newfacet' but it is not on new vertex list v%d\n", vertex->idcxx . . $ vertexT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newvertex_list));
1284 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, qh->visible_listcxx . . $ qhT#visible_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1285 }
1286 }
1287 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1288 if (facet->visiblecxx . . $ facetT#visible.)
1289 continue;
1290 if (facet->simplicialcxx . . $ facetT#simplicial.)
1291 numridges += qh->hull_dimcxx . . $ qhT#hull_dim.;
1292 else
1293 numridges += qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->ridgescxx . . $ facetT#ridges.);
1294 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices) {
1295 vertex->visitidcxx . . $ vertexT#visitid.++;
1296 if (!vertex->seencxx . . $ vertexT#seen.) {
1297 vertex->seencxx . . $ vertexT#seen.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1298 numvertices++;
1299 if (qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.) == qh_IDunknowncxx . . $ qh_IDunknown.) {
1300 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6139, "qhull internal error (qh_checkpolygon): unknown point %p for vertex v%d first_point %p\n",
1301 (void *) vertex->pointcxx . . $ vertexT#point., vertex->idcxx . . $ vertexT#id., (void *) qh->first_pointcxx . . $ qhT#first_point.);
1302 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1303 }
1304 }
1305 }
1306 }
1307 qh->vertex_visitcxx . . $ qhT#vertex_visit. += (unsigned int)numfacets;
1308 if (facetlist == qh->facet_listcxx . . $ qhT#facet_list.) {
1309 if (numfacets != qh->num_facetscxx . . $ qhT#num_facets. - qh->num_visiblecxx . . $ qhT#num_visible.) {
1310 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6140, "qhull internal error (qh_checkpolygon): actual number of facets is %d, cumulative facet count is %d - %d visible facets\n",
1311 numfacets, qh->num_facetscxx . . $ qhT#num_facets., qh->num_visiblecxx . . $ qhT#num_visible.);
1312 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1313 }
1314 qh->vertex_visitcxx . . $ qhT#vertex_visit.++;
1315 if (qh->VERTEXneighborscxx . . $ qhT#VERTEXneighbors.) {
1316 FORALLverticescxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:961:9`! {
1317 if (!vertex->neighborscxx . . $ vertexT#neighbors.) {
1318 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6407, "qhull internal error (qh_checkpolygon): missing vertex neighbors for v%d\n", vertex->idcxx . . $ vertexT#id.);
1319 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1320 }
1321 qh_setcheckcxx . . $ qh_setcheck(5f4a79f4fde3d990).(qh, vertex->neighborscxx . . $ vertexT#neighbors., "neighbors for v", vertex->idcxx . . $ vertexT#id.);
1322 if (vertex->deletedcxx . . $ vertexT#deleted.)
1323 continue;
1324 totvneighbors += qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, vertex->neighborscxx . . $ vertexT#neighbors.);
1325 }
1326 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1327 if (!facet->visiblecxx . . $ facetT#visible.)
1328 totfacetvertices += qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->verticescxx . . $ facetT#vertices.);
1329 }
1330 if (totvneighbors != totfacetvertices) {
1331 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6141, "qhull internal error (qh_checkpolygon): vertex neighbors inconsistent (tot_vneighbors %d != tot_facetvertices %d). Maybe duplicate or missing vertex\n",
1332 totvneighbors, totfacetvertices);
1333 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1334 FORALLverticescxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:961:9`! {
1335 if (vertex->deletedcxx . . $ vertexT#deleted.)
1336 continue;
1337 qh->visit_idcxx . . $ qhT#visit_id.++;
1338 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(vertex) {
1339 if (neighbor->visitidcxx . . $ facetT#visitid.==qh->visit_idcxx . . $ qhT#visit_id.) {
1340 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6275, "qhull internal error (qh_checkpolygon): facet f%d occurs twice in neighbors of vertex v%d\n",
1341 neighbor->idcxx . . $ facetT#id., vertex->idcxx . . $ vertexT#id.);
1342 errorfacet2= errorfacet;
1343 errorfacet= neighbor;
1344 }
1345 neighbor->visitidcxx . . $ facetT#visitid.= qh->visit_idcxx . . $ qhT#visit_id.;
1346 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(neighbor->verticescxx . . $ facetT#vertices., vertex)) {
1347 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6276, "qhull internal error (qh_checkpolygon): facet f%d is a neighbor of vertex v%d but v%d is not a vertex of f%d\n",
1348 neighbor->idcxx . . $ facetT#id., vertex->idcxx . . $ vertexT#id., vertex->idcxx . . $ vertexT#id., neighbor->idcxx . . $ facetT#id.);
1349 errorfacet2= errorfacet;
1350 errorfacet= neighbor;
1351 }
1352 }
1353 }
1354 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist){
1355 if (!facet->visiblecxx . . $ facetT#visible.) {
1356 /* vertices are inverse sorted and are unlikely to be duplicated */
1357 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices){
1358 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(vertex->neighborscxx . . $ vertexT#neighbors., facet)) {
1359 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6277, "qhull internal error (qh_checkpolygon): v%d is a vertex of facet f%d but f%d is not a neighbor of v%d\n",
1360 vertex->idcxx . . $ vertexT#id., facet->idcxx . . $ facetT#id., facet->idcxx . . $ facetT#id., vertex->idcxx . . $ vertexT#id.);
1361 errorfacet2= errorfacet;
1362 errorfacet= facet;
1363 }
1364 }
1365 }
1366 }
1367 }
1368 }
1369 if (numvertices != qh->num_verticescxx . . $ qhT#num_vertices. - qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->del_verticescxx . . $ qhT#del_vertices.)) {
1370 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6142, "qhull internal error (qh_checkpolygon): actual number of vertices is %d, cumulative vertex count is %d\n",
1371 numvertices, qh->num_verticescxx . . $ qhT#num_vertices. - qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->del_verticescxx . . $ qhT#del_vertices.));
1372 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1373 }
1374 if (qh->hull_dimcxx . . $ qhT#hull_dim. == 2 && numvertices != numfacets) {
1375 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6143, "qhull internal error (qh_checkpolygon): #vertices %d != #facets %d\n",
1376 numvertices, numfacets);
1377 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1378 }
1379 if (qh->hull_dimcxx . . $ qhT#hull_dim. == 3 && numvertices + numfacets - numridges/2 != 2) {
1380 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7063, "qhull warning: #vertices %d + #facets %d - #edges %d != 2. A vertex appears twice in a edge list. May occur during merging.\n",
1381 numvertices, numfacets, numridges/2);
1382 /* occurs if lots of merging and a vertex ends up twice in an edge list. e.g., RBOX 1000 s W1e-13 t995849315 D2 | QHULL d Tc Tv */
1383 }
1384 }
1385 if (waserror)
1386 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, errorfacet, errorfacet2);
1387 } /* checkpolygon */
1388
1389
1390 /*-<a href="qh-poly_r.htm#TOC"
1391 >-------------------------------</a><a name="checkvertex">-</a>
1392
1393 qh_checkvertex(qh, vertex, allchecks, &waserror )
1394 check vertex for consistency
1395 if allchecks, checks vertex->neighbors
1396
1397 returns:
1398 sets waserror if any error occurs
1399
1400 notes:
1401 called by qh_tracemerge and qh_checkpolygon
1402 neighbors checked efficiently in qh_checkpolygon
1403 */
1404 void qh_checkvertexcxx . . $ qh_checkvertex(e87e7017dd93a6fb).(qhTcxx . . $ qhT# *qh, vertexTcxx . . $ vertexT# *vertex, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! allchecks, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! *waserrorp) {
1405 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! waserror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1406 facetTcxx . . $ facetT# *neighbor, **neighborp, *errfacet=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1407
1408 if (qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.) == qh_IDunknowncxx . . $ qh_IDunknown.) {
1409 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6144, "qhull internal error (qh_checkvertex): unknown point id %p\n", (void *) vertex->pointcxx . . $ vertexT#point.);
1410 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1411 }
1412 if (vertex->idcxx . . $ vertexT#id. >= qh->vertex_idcxx . . $ qhT#vertex_id.) {
1413 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6145, "qhull internal error (qh_checkvertex): unknown vertex id v%d >= qh.vertex_id (%d)\n", vertex->idcxx . . $ vertexT#id., qh->vertex_idcxx . . $ qhT#vertex_id.);
1414 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1415 }
1416 if (vertex->visitidcxx . . $ vertexT#visitid. > qh->vertex_visitcxx . . $ qhT#vertex_visit.) {
1417 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6413, "qhull internal error (qh_checkvertex): expecting v%d.visitid <= qh.vertex_visit (%d). Got visitid %d\n", vertex->idcxx . . $ vertexT#id., qh->vertex_visitcxx . . $ qhT#vertex_visit., vertex->visitidcxx . . $ vertexT#visitid.);
1418 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1419 }
1420 if (allchecks && !waserror && !vertex->deletedcxx . . $ vertexT#deleted.) {
1421 if (qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, vertex->neighborscxx . . $ vertexT#neighbors.)) {
1422 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(vertex) {
1423 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(neighbor->verticescxx . . $ facetT#vertices., vertex)) {
1424 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6146, "qhull internal error (qh_checkvertex): neighbor f%d does not contain v%d\n", neighbor->idcxx . . $ facetT#id., vertex->idcxx . . $ vertexT#id.);
1425 errfacet= neighbor;
1426 waserror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1427 }
1428 }
1429 }
1430 }
1431 if (waserror) {
1432 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, vertex);
1433 if (errfacet)
1434 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, errfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1435 *waserrorp= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1436 }
1437 } /* checkvertex */
1438
1439 /*-<a href="qh-poly_r.htm#TOC"
1440 >-------------------------------</a><a name="clearcenters">-</a>
1441
1442 qh_clearcenters(qh, type )
1443 clear old data from facet->center
1444
1445 notes:
1446 sets new centertype
1447 nop if CENTERtype is the same
1448 */
1449 void qh_clearcenterscxx . . $ qh_clearcenters(9d998a3034dc2f87).(qhTcxx . . $ qhT# *qh, qh_CENTERcxx . . $ qh_CENTER# type) {
1450 facetTcxx . . $ facetT# *facet;
1451
1452 if (qh->CENTERtypecxx . . $ qhT#CENTERtype. != type) {
1453 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
1454 if (facet->tricoplanarcxx . . $ facetT#tricoplanar. && !facet->keepcentrumcxx . . $ facetT#keepcentrum.)
1455 facet->centercxx . . $ facetT#center.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; /* center is owned by the ->keepcentrum facet */
1456 else if (qh->CENTERtypecxx . . $ qhT#CENTERtype. == qh_ASvoronoicxx . . $ qh_ASvoronoi.){
1457 if (facet->centercxx . . $ facetT#center.) {
1458 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, facet->centercxx . . $ facetT#center., qh->center_sizecxx . . $ qhT#center_size.);
1459 facet->centercxx . . $ facetT#center.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1460 }
1461 }else /* qh.CENTERtype == qh_AScentrum */ {
1462 if (facet->centercxx . . $ facetT#center.) {
1463 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, facet->centercxx . . $ facetT#center., qh->normal_sizecxx . . $ qhT#normal_size.);
1464 facet->centercxx . . $ facetT#center.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1465 }
1466 }
1467 }
1468 qh->CENTERtypecxx . . $ qhT#CENTERtype.= type;
1469 }
1470 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2043, "qh_clearcenters: switched to center type %d\n", type));
1471 } /* clearcenters */
1472
1473 /*-<a href="qh-poly_r.htm#TOC"
1474 >-------------------------------</a><a name="createsimplex">-</a>
1475
1476 qh_createsimplex(qh, vertices )
1477 creates a simplex from a set of vertices
1478
1479 returns:
1480 initializes qh.facet_list to the simplex
1481
1482 notes:
1483 only called by qh_initialhull
1484
1485 design:
1486 for each vertex
1487 create a new facet
1488 for each new facet
1489 create its neighbor set
1490 */
1491 void qh_createsimplexcxx . . $ qh_createsimplex(8608e985da769b75).(qhTcxx . . $ qhT# *qh, setTcxx . . $ setT# *vertices /* qh.facet_list */) {
1492 facetTcxx . . $ facetT# *facet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *newfacet;
1493 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! toporient= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1494 int vertex_i, vertex_n, nth;
1495 setTcxx . . $ setT# *newfacets= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, qh->hull_dimcxx . . $ qhT#hull_dim.+1);
1496 vertexTcxx . . $ vertexT# *vertex;
1497
1498 FOREACHvertex_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1125:9`!(qh, vertices) {
1499 newfacet= qh_newfacetcxx . . $ qh_newfacet(5ab391dae1598d95).(qh);
1500 newfacet->verticescxx . . $ facetT#vertices.= qh_setnew_delnthsortedcxx . . $ qh_setnew_delnthsorted(8e6bbbfae9f71594).(qh, vertices, vertex_n, vertex_i, 0);
1501 if (toporient)
1502 newfacet->toporientcxx . . $ facetT#toporient.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1503 qh_appendfacetcxx . . $ qh_appendfacet(6436bdf99f629b76).(qh, newfacet);
1504 newfacet->newfacetcxx . . $ facetT#newfacet.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1505 qh_appendvertexcxx . . $ qh_appendvertex(3be63de346aefe7d).(qh, vertex);
1506 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &newfacets, newfacet);
1507 toporient ^= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1508 }
1509 FORALLnew_facetscxx . . $ `vendor/qhull/libqhull_r/poly_r.h:90:9`! {
1510 nth= 0;
1511 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(qh->newfacet_list) {
1512 if (facet != newfacet)
1513 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(newfacet->neighbors, nth++)= facet;
1514 }
1515 qh_settruncatecxx . . $ qh_settruncate(98aa07c3e0c03500).(qh, newfacet->neighborscxx . . $ facetT#neighbors., qh->hull_dimcxx . . $ qhT#hull_dim.);
1516 }
1517 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &newfacets);
1518 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1028, "qh_createsimplex: created simplex\n"));
1519 } /* createsimplex */
1520
1521 /*-<a href="qh-poly_r.htm#TOC"
1522 >-------------------------------</a><a name="delridge">-</a>
1523
1524 qh_delridge(qh, ridge )
1525 delete a ridge's vertices and frees its memory
1526
1527 notes:
1528 assumes r.top->ridges and r.bottom->ridges have been updated
1529 */
1530 void qh_delridgecxx . . $ qh_delridge(19ea2400ed1d8228).(qhTcxx . . $ qhT# *qh, ridgeTcxx . . $ ridgeT# *ridge) {
1531
1532 if (ridge == qh->traceridgecxx . . $ qhT#traceridge.)
1533 qh->traceridgecxx . . $ qhT#traceridge.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1534 qh_setfreecxx . . $ qh_setfree(8a9e83df9950f349).(qh, &(ridge->verticescxx . . $ ridgeT#vertices.));
1535 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, ridge, (int)sizeof(ridgeTcxx . . $ ridgeT#));
1536 } /* delridge */
1537
1538 /*-<a href="qh-poly_r.htm#TOC"
1539 >-------------------------------</a><a name="delvertex">-</a>
1540
1541 qh_delvertex(qh, vertex )
1542 deletes a vertex and frees its memory
1543
1544 notes:
1545 assumes vertex->adjacencies have been updated if needed
1546 unlinks from vertex_list
1547 */
1548 void qh_delvertexcxx . . $ qh_delvertex(3be63de346aefe7d).(qhTcxx . . $ qhT# *qh, vertexTcxx . . $ vertexT# *vertex) {
1549
1550 if (vertex->deletedcxx . . $ vertexT#deleted. && !vertex->partitionedcxx . . $ vertexT#partitioned. && !qh->NOerrexitcxx . . $ qhT#NOerrexit.) {
1551 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6395, "qhull internal error (qh_delvertex): vertex v%d was deleted but it was not partitioned as a coplanar point\n",
1552 vertex->idcxx . . $ vertexT#id.);
1553 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1554 }
1555 if (vertex == qh->tracevertexcxx . . $ qhT#tracevertex.)
1556 qh->tracevertexcxx . . $ qhT#tracevertex.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1557 qh_removevertexcxx . . $ qh_removevertex(3be63de346aefe7d).(qh, vertex);
1558 qh_setfreecxx . . $ qh_setfree(8a9e83df9950f349).(qh, &vertex->neighborscxx . . $ vertexT#neighbors.);
1559 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, vertex, (int)sizeof(vertexTcxx . . $ vertexT#));
1560 } /* delvertex */
1561
1562
1563 /*-<a href="qh-poly_r.htm#TOC"
1564 >-------------------------------</a><a name="facet3vertex">-</a>
1565
1566 qh_facet3vertex(qh )
1567 return temporary set of 3-d vertices in qh_ORIENTclock order
1568
1569 design:
1570 if simplicial facet
1571 build set from facet->vertices with facet->toporient
1572 else
1573 for each ridge in order
1574 build set from ridge's vertices
1575 */
1576 setTcxx . . $ setT# *qh_facet3vertexcxx . . $ qh_facet3vertex(91d05ab66843a48c).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet) {
1577 ridgeTcxx . . $ ridgeT# *ridge, *firstridge;
1578 vertexTcxx . . $ vertexT# *vertex;
1579 int cntvertices, cntprojected=0;
1580 setTcxx . . $ setT# *vertices;
1581
1582 cntvertices= qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->verticescxx . . $ facetT#vertices.);
1583 vertices= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, cntvertices);
1584 if (facet->simplicialcxx . . $ facetT#simplicial.) {
1585 if (cntvertices != 3) {
1586 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6147, "qhull internal error (qh_facet3vertex): only %d vertices for simplicial facet f%d\n",
1587 cntvertices, facet->idcxx . . $ facetT#id.);
1588 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1589 }
1590 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &vertices, SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(facet->vertices));
1591 if (facet->toporientcxx . . $ facetT#toporient. ^ qh_ORIENTclockcxx . . $ `vendor/qhull/libqhull_r/user_r.h:328:9`!)
1592 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &vertices, SETsecond_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:396:9`!(facet->vertices));
1593 else
1594 qh_setaddnthcxx . . $ qh_setaddnth(4353c65cb7d1d819).(qh, &vertices, 0, SETsecond_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:396:9`!(facet->vertices));
1595 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &vertices, SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(facet->vertices, 2));
1596 }else {
1597 ridge= firstridge= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(facet->ridges, ridgeT); /* no infinite */
1598 while ((ridge= qh_nextridge3dcxx . . $ qh_nextridge3d(89b412cdf82596f4).(ridge, facet, &vertex))) {
1599 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &vertices, vertex);
1600 if (++cntprojected > cntvertices || ridge == firstridge)
1601 break;
1602 }
1603 if (!ridge || cntprojected != cntvertices) {
1604 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6148, "qhull internal error (qh_facet3vertex): ridges for facet %d don't match up. got at least %d\n",
1605 facet->idcxx . . $ facetT#id., cntprojected);
1606 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, ridge);
1607 }
1608 }
1609 return vertices;
1610 } /* facet3vertex */
1611
1612 /*-<a href="qh-poly_r.htm#TOC"
1613 >-------------------------------</a><a name="findbestfacet">-</a>
1614
1615 qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside )
1616 find facet that is furthest below a point
1617
1618 for Delaunay triangulations,
1619 Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed
1620 Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates.
1621
1622 returns:
1623 if bestoutside is set (e.g., qh_ALL)
1624 returns best facet that is not upperdelaunay
1625 if Delaunay and inside, point is outside circumsphere of bestfacet
1626 else
1627 returns first facet below point
1628 if point is inside, returns nearest, !upperdelaunay facet
1629 distance to facet
1630 isoutside set if outside of facet
1631
1632 notes:
1633 Distance is measured by distance to the facet's hyperplane. For
1634 Delaunay facets, this is not the same as the containing facet. It may
1635 be an adjacent facet or a different tricoplanar facet. See
1636 <a href="../html/qh-code.htm#findfacet">locate a facet with qh_findbestfacet()</a>
1637
1638 For tricoplanar facets, this finds one of the tricoplanar facets closest
1639 to the point.
1640
1641 If inside, qh_findbestfacet performs an exhaustive search
1642 this may be too conservative. Sometimes it is clearly required.
1643
1644 qh_findbestfacet is not used by qhull.
1645 uses qh.visit_id and qh.coplanarset
1646
1647 see:
1648 <a href="geom_r.c#findbest">qh_findbest</a>
1649 */
1650 facetTcxx . . $ facetT# *qh_findbestfacetcxx . . $ qh_findbestfacet(c31b1fbf107139bc).(qhTcxx . . $ qhT# *qh, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! bestoutside,
1651 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! *bestdist, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! *isoutside) {
1652 facetTcxx . . $ facetT# *bestfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1653 int numpart, totpart= 0;
1654
1655 bestfacet= qh_findbestcxx . . $ qh_findbest(f96d9a2261a2fccf).(qh, point, qh->facet_listcxx . . $ qhT#facet_list.,
1656 bestoutside, !qh_ISnewfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:192:9`!, bestoutside /* qh_NOupper */,
1657 bestdist, isoutside, &totpart);
1658 if (*bestdist < -qh->DISTroundcxx . . $ qhT#DISTround.) {
1659 bestfacet= qh_findfacet_allcxx . . $ qh_findfacet_all(7a15204fe15eb60e).(qh, point, !qh_NOuppercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:190:9`!, bestdist, isoutside, &numpart);
1660 totpart += numpart;
1661 if ((isoutside && *isoutside && bestoutside)
1662 || (isoutside && !*isoutside && bestfacet->upperdelaunaycxx . . $ facetT#upperdelaunay.)) {
1663 bestfacet= qh_findbestcxx . . $ qh_findbest(f96d9a2261a2fccf).(qh, point, bestfacet,
1664 bestoutside, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, bestoutside,
1665 bestdist, isoutside, &totpart);
1666 totpart += numpart;
1667 }
1668 }
1669 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3014, "qh_findbestfacet: f%d dist %2.2g isoutside %d totpart %d\n",
1670 bestfacet->id, *bestdist, (isoutside ? *isoutside : UINT_MAX), totpart));
1671 return bestfacet;
1672 } /* findbestfacet */
1673
1674 /*-<a href="qh-poly_r.htm#TOC"
1675 >-------------------------------</a><a name="findbestlower">-</a>
1676
1677 qh_findbestlower(qh, facet, point, bestdist, numpart )
1678 returns best non-upper, non-flipped neighbor of facet for point
1679 if needed, searches vertex neighbors
1680
1681 returns:
1682 returns bestdist and updates numpart
1683
1684 notes:
1685 called by qh_findbest() for points above an upperdelaunay facet
1686 if Delaunay and inside, point is outside of circumsphere of bestfacet
1687
1688 */
1689 facetTcxx . . $ facetT# *qh_findbestlowercxx . . $ qh_findbestlower(36cffba387dafe58).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *upperfacet, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! *bestdistp, int *numpart) {
1690 facetTcxx . . $ facetT# *neighbor, **neighborp, *bestfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1691 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! bestdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2 /* avoid underflow */;
1692 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist;
1693 vertexTcxx . . $ vertexT# *vertex;
1694 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! isoutside= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!; /* not used */
1695
1696 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zbestlower);
1697 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(upperfacet) {
1698 if (neighbor->upperdelaunaycxx . . $ facetT#upperdelaunay. || neighbor->flippedcxx . . $ facetT#flipped.)
1699 continue;
1700 (*numpart)++;
1701 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, neighbor, &dist);
1702 if (dist > bestdist) {
1703 bestfacet= neighbor;
1704 bestdist= dist;
1705 }
1706 }
1707 if (!bestfacet) {
1708 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zbestlowerv);
1709 /* rarely called, numpart does not count nearvertex computations */
1710 vertex= qh_nearvertexcxx . . $ qh_nearvertex(a250672dbb319d8b).(qh, upperfacet, point, &dist);
1711 qh_vertexneighborscxx . . $ qh_vertexneighbors(fb32973c8cc8eae9).(qh);
1712 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(vertex) {
1713 if (neighbor->upperdelaunaycxx . . $ facetT#upperdelaunay. || neighbor->flippedcxx . . $ facetT#flipped.)
1714 continue;
1715 (*numpart)++;
1716 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, neighbor, &dist);
1717 if (dist > bestdist) {
1718 bestfacet= neighbor;
1719 bestdist= dist;
1720 }
1721 }
1722 }
1723 if (!bestfacet) {
1724 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zbestlowerall); /* invoked once per point in outsideset */
1725 zmax_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:474:9`!(Zbestloweralln, qh->num_facets);
1726 /* [dec'15] Previously reported as QH6228 */
1727 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3025, "qh_findbestlower: all neighbors of facet %d are flipped or upper Delaunay. Search all facets\n",
1728 upperfacet->id));
1729 /* rarely called */
1730 bestfacet= qh_findfacet_allcxx . . $ qh_findfacet_all(7a15204fe15eb60e).(qh, point, qh_NOuppercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:190:9`!, &bestdist, &isoutside, numpart);
1731 }
1732 *bestdistp= bestdist;
1733 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3015, "qh_findbestlower: f%d dist %2.2g for f%d p%d\n",
1734 bestfacet->id, bestdist, upperfacet->id, qh_pointid(qh, point)));
1735 return bestfacet;
1736 } /* findbestlower */
1737
1738 /*-<a href="qh-poly_r.htm#TOC"
1739 >-------------------------------</a><a name="findfacet_all">-</a>
1740
1741 qh_findfacet_all(qh, point, noupper, bestdist, isoutside, numpart )
1742 exhaustive search for facet below a point
1743 ignore flipped and visible facets, f.normal==NULL, and if noupper, f.upperdelaunay facets
1744
1745 for Delaunay triangulations,
1746 Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed
1747 Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates.
1748
1749 returns:
1750 returns first facet below point
1751 if point is inside,
1752 returns nearest facet
1753 distance to facet
1754 isoutside if point is outside of the hull
1755 number of distance tests
1756
1757 notes:
1758 called by qh_findbestlower if all neighbors are flipped or upper Delaunay (QH3025)
1759 primarily for library users (qh_findbestfacet), rarely used by Qhull
1760 */
1761 facetTcxx . . $ facetT# *qh_findfacet_allcxx . . $ qh_findfacet_all(7a15204fe15eb60e).(qhTcxx . . $ qhT# *qh, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! noupper, realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! *bestdist, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! *isoutside,
1762 int *numpart) {
1763 facetTcxx . . $ facetT# *bestfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *facet;
1764 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist;
1765 int totpart= 0;
1766
1767 *bestdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
1768 *isoutside= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1769 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
1770 if (facet->flippedcxx . . $ facetT#flipped. || !facet->normalcxx . . $ facetT#normal. || facet->visiblecxx . . $ facetT#visible.)
1771 continue;
1772 if (noupper && facet->upperdelaunaycxx . . $ facetT#upperdelaunay.)
1773 continue;
1774 totpart++;
1775 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
1776 if (dist > *bestdist) {
1777 *bestdist= dist;
1778 bestfacet= facet;
1779 if (dist > qh->MINoutsidecxx . . $ qhT#MINoutside.) {
1780 *isoutside= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1781 break;
1782 }
1783 }
1784 }
1785 *numpart= totpart;
1786 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3016, "qh_findfacet_all: p%d, noupper? %d, f%d, dist %2.2g, isoutside %d, totpart %d\n",
1787 qh_pointid(qh, point), noupper, getid_(bestfacet), *bestdist, *isoutside, totpart));
1788 return bestfacet;
1789 } /* findfacet_all */
1790
1791 /*-<a href="qh-poly_r.htm#TOC"
1792 >-------------------------------</a><a name="findgood">-</a>
1793
1794 qh_findgood(qh, facetlist, goodhorizon )
1795 identify good facets for qh.PRINTgood and qh_buildcone_onlygood
1796 goodhorizon is count of good, horizon facets from qh_find_horizon, otherwise 0 from qh_findgood_all
1797 if not qh.MERGING and qh.GOODvertex>0
1798 facet includes point as vertex
1799 if !match, returns goodhorizon
1800 if qh.GOODpoint
1801 facet is visible or coplanar (>0) or not visible (<0)
1802 if qh.GOODthreshold
1803 facet->normal matches threshold
1804 if !goodhorizon and !match,
1805 selects facet with closest angle to thresholds
1806 sets GOODclosest
1807
1808 returns:
1809 number of new, good facets found
1810 determines facet->good
1811 may update qh.GOODclosest
1812
1813 notes:
1814 called from qh_initbuild, qh_buildcone_onlygood, and qh_findgood_all
1815 qh_findgood_all (called from qh_prepare_output) further reduces the good region
1816
1817 design:
1818 count good facets
1819 if not merging, clear good facets that fail qh.GOODvertex ('QVn', but not 'QV-n')
1820 clear good facets that fail qh.GOODpoint ('QGn' or 'QG-n')
1821 clear good facets that fail qh.GOODthreshold
1822 if !goodhorizon and !find f.good,
1823 sets GOODclosest to facet with closest angle to thresholds
1824 */
1825 int qh_findgoodcxx . . $ qh_findgood(1394db21f60ce6e4).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist, int goodhorizon) {
1826 facetTcxx . . $ facetT# *facet, *bestfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1827 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! angle, bestangle= REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!, dist;
1828 int numgood=0;
1829
1830 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1831 if (facet->goodcxx . . $ facetT#good.)
1832 numgood++;
1833 }
1834 if (qh->GOODvertexcxx . . $ qhT#GOODvertex.>0 && !qh->MERGINGcxx . . $ qhT#MERGING.) {
1835 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1836 if (facet->goodcxx . . $ facetT#good. && !qh_isvertexcxx . . $ qh_isvertex(51f7266b1cea03d4).(qh->GOODvertexpcxx . . $ qhT#GOODvertexp., facet->verticescxx . . $ facetT#vertices.)) {
1837 facet->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1838 numgood--;
1839 }
1840 }
1841 }
1842 if (qh->GOODpointcxx . . $ qhT#GOODpoint. && numgood) {
1843 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1844 if (facet->goodcxx . . $ facetT#good. && facet->normalcxx . . $ facetT#normal.) {
1845 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zdistgood);
1846 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, qh->GOODpointpcxx . . $ qhT#GOODpointp., facet, &dist);
1847 if ((qh->GOODpointcxx . . $ qhT#GOODpoint. > 0) ^ (dist > 0.0)) {
1848 facet->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1849 numgood--;
1850 }
1851 }
1852 }
1853 }
1854 if (qh->GOODthresholdcxx . . $ qhT#GOODthreshold. && (numgood || goodhorizon || qh->GOODclosestcxx . . $ qhT#GOODclosest.)) {
1855 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1856 if (facet->goodcxx . . $ facetT#good. && facet->normalcxx . . $ facetT#normal.) {
1857 if (!qh_inthresholdscxx . . $ qh_inthresholds(6fab521714bb25e3).(qh, facet->normalcxx . . $ facetT#normal., &angle)) {
1858 facet->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1859 numgood--;
1860 if (angle < bestangle) {
1861 bestangle= angle;
1862 bestfacet= facet;
1863 }
1864 }
1865 }
1866 }
1867 if (numgood == 0 && (goodhorizon == 0 || qh->GOODclosestcxx . . $ qhT#GOODclosest.)) {
1868 if (qh->GOODclosestcxx . . $ qhT#GOODclosest.) {
1869 if (qh->GOODclosestcxx . . $ qhT#GOODclosest.->visiblecxx . . $ facetT#visible.)
1870 qh->GOODclosestcxx . . $ qhT#GOODclosest.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1871 else {
1872 qh_inthresholdscxx . . $ qh_inthresholds(6fab521714bb25e3).(qh, qh->GOODclosestcxx . . $ qhT#GOODclosest.->normalcxx . . $ facetT#normal., &angle);
1873 if (angle < bestangle)
1874 bestfacet= qh->GOODclosestcxx . . $ qhT#GOODclosest.;
1875 }
1876 }
1877 if (bestfacet && bestfacet != qh->GOODclosestcxx . . $ qhT#GOODclosest.) { /* numgood == 0 */
1878 if (qh->GOODclosestcxx . . $ qhT#GOODclosest.)
1879 qh->GOODclosestcxx . . $ qhT#GOODclosest.->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1880 qh->GOODclosestcxx . . $ qhT#GOODclosest.= bestfacet;
1881 bestfacet->goodcxx . . $ facetT#good.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1882 numgood++;
1883 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2044, "qh_findgood: f%d is closest(%2.2g) to thresholds\n",
1884 bestfacet->id, bestangle));
1885 return numgood;
1886 }
1887 }else if (qh->GOODclosestcxx . . $ qhT#GOODclosest.) { /* numgood > 0 */
1888 qh->GOODclosestcxx . . $ qhT#GOODclosest.->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1889 qh->GOODclosestcxx . . $ qhT#GOODclosest.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1890 }
1891 }
1892 zadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:443:9`!(Zgoodfacet, numgood);
1893 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2045, "qh_findgood: found %d good facets with %d good horizon and qh.GOODclosest f%d\n",
1894 numgood, goodhorizon, getid_(qh->GOODclosest)));
1895 if (!numgood && qh->GOODvertexcxx . . $ qhT#GOODvertex.>0 && !qh->MERGINGcxx . . $ qhT#MERGING.)
1896 return goodhorizon;
1897 return numgood;
1898 } /* findgood */
1899
1900 /*-<a href="qh-poly_r.htm#TOC"
1901 >-------------------------------</a><a name="findgood_all">-</a>
1902
1903 qh_findgood_all(qh, facetlist )
1904 apply other constraints for good facets (used by qh.PRINTgood)
1905 if qh.GOODvertex
1906 facet includes (>0) or doesn't include (<0) point as vertex
1907 if last good facet and ONLYgood, prints warning and continues
1908 if qh.SPLITthresholds (e.g., qh.DELAUNAY)
1909 facet->normal matches threshold, or if none, the closest one
1910 calls qh_findgood
1911 nop if good not used
1912
1913 returns:
1914 clears facet->good if not good
1915 sets qh.num_good
1916
1917 notes:
1918 called by qh_prepare_output and qh_printneighborhood
1919 unless qh.ONLYgood, calls qh_findgood first
1920
1921 design:
1922 uses qh_findgood to mark good facets
1923 clear f.good for failed qh.GOODvertex
1924 clear f.good for failed qh.SPLITthreholds
1925 if no more good facets, select best of qh.SPLITthresholds
1926 */
1927 void qh_findgood_allcxx . . $ qh_findgood_all(6436bdf99f629b76).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist) {
1928 facetTcxx . . $ facetT# *facet, *bestfacet=NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1929 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! angle, bestangle= REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
1930 int numgood=0, startgood;
1931
1932 if (!qh->GOODvertexcxx . . $ qhT#GOODvertex. && !qh->GOODthresholdcxx . . $ qhT#GOODthreshold. && !qh->GOODpointcxx . . $ qhT#GOODpoint.
1933 && !qh->SPLITthresholdscxx . . $ qhT#SPLITthresholds.)
1934 return;
1935 if (!qh->ONLYgoodcxx . . $ qhT#ONLYgood.)
1936 qh_findgoodcxx . . $ qh_findgood(1394db21f60ce6e4).(qh, qh->facet_listcxx . . $ qhT#facet_list., 0);
1937 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1938 if (facet->goodcxx . . $ facetT#good.)
1939 numgood++;
1940 }
1941 if (qh->GOODvertexcxx . . $ qhT#GOODvertex. <0 || (qh->GOODvertexcxx . . $ qhT#GOODvertex. > 0 && qh->MERGINGcxx . . $ qhT#MERGING.)) {
1942 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1943 if (facet->goodcxx . . $ facetT#good. && ((qh->GOODvertexcxx . . $ qhT#GOODvertex. > 0) ^ !!qh_isvertexcxx . . $ qh_isvertex(51f7266b1cea03d4).(qh->GOODvertexpcxx . . $ qhT#GOODvertexp., facet->verticescxx . . $ facetT#vertices.))) { /* convert to bool */
1944 if (!--numgood) {
1945 if (qh->ONLYgoodcxx . . $ qhT#ONLYgood.) {
1946 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7064, "qhull warning: good vertex p%d does not match last good facet f%d. Ignored.\n",
1947 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, qh->GOODvertexpcxx . . $ qhT#GOODvertexp.), facet->idcxx . . $ facetT#id.);
1948 return;
1949 }else if (qh->GOODvertexcxx . . $ qhT#GOODvertex. > 0)
1950 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7065, "qhull warning: point p%d is not a vertex('QV%d').\n",
1951 qh->GOODvertexcxx . . $ qhT#GOODvertex.-1, qh->GOODvertexcxx . . $ qhT#GOODvertex.-1);
1952 else
1953 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7066, "qhull warning: point p%d is a vertex for every facet('QV-%d').\n",
1954 -qh->GOODvertexcxx . . $ qhT#GOODvertex. - 1, -qh->GOODvertexcxx . . $ qhT#GOODvertex. - 1);
1955 }
1956 facet->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1957 }
1958 }
1959 }
1960 startgood= numgood;
1961 if (qh->SPLITthresholdscxx . . $ qhT#SPLITthresholds.) {
1962 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist) {
1963 if (facet->goodcxx . . $ facetT#good.) {
1964 if (!qh_inthresholdscxx . . $ qh_inthresholds(6fab521714bb25e3).(qh, facet->normalcxx . . $ facetT#normal., &angle)) {
1965 facet->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1966 numgood--;
1967 if (angle < bestangle) {
1968 bestangle= angle;
1969 bestfacet= facet;
1970 }
1971 }
1972 }
1973 }
1974 if (!numgood && bestfacet) {
1975 bestfacet->goodcxx . . $ facetT#good.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
1976 numgood++;
1977 trace0cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:87:9`!((qh, qh->ferr, 23, "qh_findgood_all: f%d is closest(%2.2g) to split thresholds\n",
1978 bestfacet->id, bestangle));
1979 return;
1980 }
1981 }
1982 if (numgood == 1 && !qh->PRINTgoodcxx . . $ qhT#PRINTgood. && qh->GOODclosestcxx . . $ qhT#GOODclosest. && qh->GOODclosestcxx . . $ qhT#GOODclosest.->goodcxx . . $ facetT#good.) {
1983 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2109, "qh_findgood_all: undo selection of qh.GOODclosest f%d since it would fail qh_inthresholds in qh_skipfacet\n",
1984 qh->GOODclosest->id));
1985 qh->GOODclosestcxx . . $ qhT#GOODclosest.->goodcxx . . $ facetT#good.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
1986 numgood= 0;
1987 }
1988 qh->num_goodcxx . . $ qhT#num_good.= numgood;
1989 trace0cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:87:9`!((qh, qh->ferr, 24, "qh_findgood_all: %d good facets remain out of %d facets\n",
1990 numgood, startgood));
1991 } /* findgood_all */
1992
1993 /*-<a href="qh-poly_r.htm#TOC"
1994 >-------------------------------</a><a name="furthestnext">-</a>
1995
1996 qh_furthestnext()
1997 set qh.facet_next to facet with furthest of all furthest points
1998 searches all facets on qh.facet_list
1999
2000 notes:
2001 this may help avoid precision problems
2002 */
2003 void qh_furthestnextcxx . . $ qh_furthestnext(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh /* qh.facet_list */) {
2004 facetTcxx . . $ facetT# *facet, *bestfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2005 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist, bestdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
2006
2007 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
2008 if (facet->outsidesetcxx . . $ facetT#outsideset.) {
2009 #if qh_COMPUTEfurthestcxx . . $ `vendor/qhull/libqhull_r/user_r.h:565:9`!
2010 pointT *furthest;
2011 furthest= (pointT *)qh_setlast(facet->outsideset);
2012 zinc_(Zcomputefurthest);
2013 qh_distplane(qh, furthest, facet, &dist);
2014 #else
2015 dist= facet->furthestdistcxx . . $ facetT#furthestdist.;
2016 #endif
2017 if (dist > bestdist) {
2018 bestfacet= facet;
2019 bestdist= dist;
2020 }
2021 }
2022 }
2023 if (bestfacet) {
2024 qh_removefacetcxx . . $ qh_removefacet(6436bdf99f629b76).(qh, bestfacet);
2025 qh_prependfacetcxx . . $ qh_prependfacet(63085aca6d33a107).(qh, bestfacet, &qh->facet_nextcxx . . $ qhT#facet_next.);
2026 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1029, "qh_furthestnext: made f%d next facet(dist %.2g)\n",
2027 bestfacet->id, bestdist));
2028 }
2029 } /* furthestnext */
2030
2031 /*-<a href="qh-poly_r.htm#TOC"
2032 >-------------------------------</a><a name="furthestout">-</a>
2033
2034 qh_furthestout(qh, facet )
2035 make furthest outside point the last point of outsideset
2036
2037 returns:
2038 updates facet->outsideset
2039 clears facet->notfurthest
2040 sets facet->furthestdist
2041
2042 design:
2043 determine best point of outsideset
2044 make it the last point of outsideset
2045 */
2046 void qh_furthestoutcxx . . $ qh_furthestout(6436bdf99f629b76).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet) {
2047 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, **pointp, *bestpoint= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2048 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist, bestdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
2049
2050 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(facet->outsideset) {
2051 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
2052 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zcomputefurthest);
2053 if (dist > bestdist) {
2054 bestpoint= point;
2055 bestdist= dist;
2056 }
2057 }
2058 if (bestpoint) {
2059 qh_setdelcxx . . $ qh_setdel(117666f5f13ff3be).(facet->outsidesetcxx . . $ facetT#outsideset., point);
2060 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &facet->outsidesetcxx . . $ facetT#outsideset., point);
2061 #if !qh_COMPUTEfurthestcxx . . $ `vendor/qhull/libqhull_r/user_r.h:565:9`!
2062 facet->furthestdistcxx . . $ facetT#furthestdist.= bestdist;
2063 #endif
2064 }
2065 facet->notfurthestcxx . . $ facetT#notfurthest.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2066 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3017, "qh_furthestout: p%d is furthest outside point of f%d\n",
2067 qh_pointid(qh, point), facet->id));
2068 } /* furthestout */
2069
2070
2071 /*-<a href="qh-qhull_r.htm#TOC"
2072 >-------------------------------</a><a name="infiniteloop">-</a>
2073
2074 qh_infiniteloop(qh, facet )
2075 report infinite loop error due to facet
2076 */
2077 void qh_infiniteloopcxx . . $ qh_infiniteloop(6436bdf99f629b76).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet) {
2078
2079 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6149, "qhull internal error (qh_infiniteloop): potential infinite loop detected. If visible, f.replace. If newfacet, f.samecycle\n");
2080 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2081 } /* qh_infiniteloop */
2082
2083 /*-<a href="qh-poly_r.htm#TOC"
2084 >-------------------------------</a><a name="initbuild">-</a>
2085
2086 qh_initbuild()
2087 initialize hull and outside sets with point array
2088 qh.FIRSTpoint/qh.NUMpoints is point array
2089 if qh.GOODpoint
2090 adds qh.GOODpoint to initial hull
2091
2092 returns:
2093 qh_facetlist with initial hull
2094 points partitioned into outside sets, coplanar sets, or inside
2095 initializes qh.GOODpointp, qh.GOODvertexp,
2096
2097 design:
2098 initialize global variables used during qh_buildhull
2099 determine precision constants and points with max/min coordinate values
2100 if qh.SCALElast, scale last coordinate(for 'd')
2101 initialize qh.newfacet_list, qh.facet_tail
2102 initialize qh.vertex_list, qh.newvertex_list, qh.vertex_tail
2103 determine initial vertices
2104 build initial simplex
2105 partition input points into facets of initial simplex
2106 set up lists
2107 if qh.ONLYgood
2108 check consistency
2109 add qh.GOODvertex if defined
2110 */
2111 void qh_initbuildcxx . . $ qh_initbuild(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
2112 setTcxx . . $ setT# *maxpoints, *vertices;
2113 facetTcxx . . $ facetT# *facet;
2114 int i, numpart;
2115 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist;
2116 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! isoutside;
2117
2118 if (qh->PRINTstatisticscxx . . $ qhT#PRINTstatistics.) {
2119 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 9350, "qhull %s Statistics: %s | %s\n",
2120 qh_versioncxx . . $ qh_version., qh->rbox_commandcxx . . $ qhT#rbox_command., qh->qhull_commandcxx . . $ qhT#qhull_command.);
2121 fflushcxx . . $ fflush(89bc1efcdac0ca22).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2122 }
2123 qh->furthest_idcxx . . $ qhT#furthest_id.= qh_IDunknowncxx . . $ qh_IDunknown.;
2124 qh->lastreportcxx . . $ qhT#lastreport.= 0;
2125 qh->lastfacetscxx . . $ qhT#lastfacets.= 0;
2126 qh->lastmergescxx . . $ qhT#lastmerges.= 0;
2127 qh->lastplanescxx . . $ qhT#lastplanes.= 0;
2128 qh->lastdistcxx . . $ qhT#lastdist.= 0;
2129 qh->facet_idcxx . . $ qhT#facet_id.= qh->vertex_idcxx . . $ qhT#vertex_id.= qh->ridge_idcxx . . $ qhT#ridge_id.= 0;
2130 qh->visit_idcxx . . $ qhT#visit_id.= qh->vertex_visitcxx . . $ qhT#vertex_visit.= 0;
2131 qh->maxoutdonecxx . . $ qhT#maxoutdone.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2132
2133 if (qh->GOODpointcxx . . $ qhT#GOODpoint. > 0)
2134 qh->GOODpointpcxx . . $ qhT#GOODpointp.= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, qh->GOODpointcxx . . $ qhT#GOODpoint.-1);
2135 else if (qh->GOODpointcxx . . $ qhT#GOODpoint. < 0)
2136 qh->GOODpointpcxx . . $ qhT#GOODpointp.= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, -qh->GOODpointcxx . . $ qhT#GOODpoint.-1);
2137 if (qh->GOODvertexcxx . . $ qhT#GOODvertex. > 0)
2138 qh->GOODvertexpcxx . . $ qhT#GOODvertexp.= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, qh->GOODvertexcxx . . $ qhT#GOODvertex.-1);
2139 else if (qh->GOODvertexcxx . . $ qhT#GOODvertex. < 0)
2140 qh->GOODvertexpcxx . . $ qhT#GOODvertexp.= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, -qh->GOODvertexcxx . . $ qhT#GOODvertex.-1);
2141 if ((qh->GOODpointcxx . . $ qhT#GOODpoint.
2142 && (qh->GOODpointpcxx . . $ qhT#GOODpointp. < qh->first_pointcxx . . $ qhT#first_point. /* also catches !GOODpointp */
2143 || qh->GOODpointpcxx . . $ qhT#GOODpointp. > qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, qh->num_pointscxx . . $ qhT#num_points.-1)))
2144 || (qh->GOODvertexcxx . . $ qhT#GOODvertex.
2145 && (qh->GOODvertexpcxx . . $ qhT#GOODvertexp. < qh->first_pointcxx . . $ qhT#first_point. /* also catches !GOODvertexp */
2146 || qh->GOODvertexpcxx . . $ qhT#GOODvertexp. > qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, qh->num_pointscxx . . $ qhT#num_points.-1)))) {
2147 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6150, "qhull input error: either QGn or QVn point is > p%d\n",
2148 qh->num_pointscxx . . $ qhT#num_points.-1);
2149 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2150 }
2151 maxpoints= qh_maxmincxx . . $ qh_maxmin(2e5e61c886db88e8).(qh, qh->first_pointcxx . . $ qhT#first_point., qh->num_pointscxx . . $ qhT#num_points., qh->hull_dimcxx . . $ qhT#hull_dim.);
2152 if (qh->SCALElastcxx . . $ qhT#SCALElast.)
2153 qh_scalelastcxx . . $ qh_scalelast(78d42c9994ce6a11).(qh, qh->first_pointcxx . . $ qhT#first_point., qh->num_pointscxx . . $ qhT#num_points., qh->hull_dimcxx . . $ qhT#hull_dim., qh->MINlastcoordcxx . . $ qhT#MINlastcoord., qh->MAXlastcoordcxx . . $ qhT#MAXlastcoord., qh->MAXabs_coordcxx . . $ qhT#MAXabs_coord.);
2154 qh_detroundoffcxx . . $ qh_detroundoff(fb32973c8cc8eae9).(qh);
2155 if (qh->DELAUNAYcxx . . $ qhT#DELAUNAY. && qh->upper_thresholdcxx . . $ qhT#upper_threshold.[qh->hull_dimcxx . . $ qhT#hull_dim.-1] > REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2
2156 && qh->lower_thresholdcxx . . $ qhT#lower_threshold.[qh->hull_dimcxx . . $ qhT#hull_dim.-1] < -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2) {
2157 for (i=qh_PRINTENDcxx . . $ qh_PRINTEND.; i--; ) {
2158 if (qh->PRINToutcxx . . $ qhT#PRINTout.[i] == qh_PRINTgeomcxx . . $ qh_PRINTgeom. && qh->DROPdimcxx . . $ qhT#DROPdim. < 0
2159 && !qh->GOODthresholdcxx . . $ qhT#GOODthreshold. && !qh->SPLITthresholdscxx . . $ qhT#SPLITthresholds.)
2160 break; /* in this case, don't set upper_threshold */
2161 }
2162 if (i < 0) {
2163 if (qh->UPPERdelaunaycxx . . $ qhT#UPPERdelaunay.) { /* matches qh.upperdelaunay in qh_setfacetplane */
2164 qh->lower_thresholdcxx . . $ qhT#lower_threshold.[qh->hull_dimcxx . . $ qhT#hull_dim.-1]= qh->ANGLEroundcxx . . $ qhT#ANGLEround. * qh_ZEROdelaunaycxx . . $ `vendor/qhull/libqhull_r/user_r.h:1030:9`!;
2165 qh->GOODthresholdcxx . . $ qhT#GOODthreshold.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
2166 }else {
2167 qh->upper_thresholdcxx . . $ qhT#upper_threshold.[qh->hull_dimcxx . . $ qhT#hull_dim.-1]= -qh->ANGLEroundcxx . . $ qhT#ANGLEround. * qh_ZEROdelaunaycxx . . $ `vendor/qhull/libqhull_r/user_r.h:1030:9`!;
2168 if (!qh->GOODthresholdcxx . . $ qhT#GOODthreshold.)
2169 qh->SPLITthresholdscxx . . $ qhT#SPLITthresholds.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!; /* build upper-convex hull even if Qg */
2170 /* qh_initqhull_globals errors if Qg without Pdk/etc. */
2171 }
2172 }
2173 }
2174 trace4cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:91:9`!((qh, qh->ferr, 4091, "qh_initbuild: create sentinels for qh.facet_tail and qh.vertex_tail\n"));
2175 qh->facet_listcxx . . $ qhT#facet_list.= qh->newfacet_listcxx . . $ qhT#newfacet_list.= qh->facet_tailcxx . . $ qhT#facet_tail.= qh_newfacetcxx . . $ qh_newfacet(5ab391dae1598d95).(qh);
2176 qh->num_facetscxx . . $ qhT#num_facets.= qh->num_verticescxx . . $ qhT#num_vertices.= qh->num_visiblecxx . . $ qhT#num_visible.= 0;
2177 qh->vertex_listcxx . . $ qhT#vertex_list.= qh->newvertex_listcxx . . $ qhT#newvertex_list.= qh->vertex_tailcxx . . $ qhT#vertex_tail.= qh_newvertexcxx . . $ qh_newvertex(b0e968ca28a6aec).(qh, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2178 vertices= qh_initialverticescxx . . $ qh_initialvertices(b40444609fbc6c3c).(qh, qh->hull_dimcxx . . $ qhT#hull_dim., maxpoints, qh->first_pointcxx . . $ qhT#first_point., qh->num_pointscxx . . $ qhT#num_points.);
2179 qh_initialhullcxx . . $ qh_initialhull(8608e985da769b75).(qh, vertices); /* initial qh->facet_list */
2180 qh_partitionallcxx . . $ qh_partitionall(32feeab59d96c90d).(qh, vertices, qh->first_pointcxx . . $ qhT#first_point., qh->num_pointscxx . . $ qhT#num_points.);
2181 if (qh->PRINToptions1stcxx . . $ qhT#PRINToptions1st. || qh->TRACElevelcxx . . $ qhT#TRACElevel. || qh->IStracingcxx . . $ qhT#IStracing.) {
2182 if (qh->TRACElevelcxx . . $ qhT#TRACElevel. || qh->IStracingcxx . . $ qhT#IStracing.)
2183 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8103, "\nTrace level T%d, IStracing %d, point TP%d, merge TM%d, dist TW%2.2g, qh.tracefacet_id %d, traceridge_id %d, tracevertex_id %d, last qh.RERUN %d, %s | %s\n",
2184 qh->TRACElevelcxx . . $ qhT#TRACElevel., qh->IStracingcxx . . $ qhT#IStracing., qh->TRACEpointcxx . . $ qhT#TRACEpoint., qh->TRACEmergecxx . . $ qhT#TRACEmerge., qh->TRACEdistcxx . . $ qhT#TRACEdist., qh->tracefacet_idcxx . . $ qhT#tracefacet_id., qh->traceridge_idcxx . . $ qhT#traceridge_id., qh->tracevertex_idcxx . . $ qhT#tracevertex_id., qh->TRACElastruncxx . . $ qhT#TRACElastrun., qh->rbox_commandcxx . . $ qhT#rbox_command., qh->qhull_commandcxx . . $ qhT#qhull_command.);
2185 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8104, "Options selected for Qhull %s:\n%s\n", qh_versioncxx . . $ qh_version., qh->qhull_optionscxx . . $ qhT#qhull_options.);
2186 }
2187 qh_resetlistscxx . . $ qh_resetlists(10b42c618dd7b8a7).(qh, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, qh_RESETvisiblecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:193:9`! /* qh.visible_list newvertex_list qh.newfacet_list */);
2188 qh->facet_nextcxx . . $ qhT#facet_next.= qh->facet_listcxx . . $ qhT#facet_list.;
2189 qh_furthestnextcxx . . $ qh_furthestnext(fb32973c8cc8eae9).(qh /* qh.facet_list */);
2190 if (qh->PREmergecxx . . $ qhT#PREmerge.) {
2191 qh->cos_maxcxx . . $ qhT#cos_max.= qh->premerge_coscxx . . $ qhT#premerge_cos.;
2192 qh->centrum_radiuscxx . . $ qhT#centrum_radius.= qh->premerge_centrumcxx . . $ qhT#premerge_centrum.; /* overwritten by qh_premerge */
2193 }
2194 if (qh->ONLYgoodcxx . . $ qhT#ONLYgood.) {
2195 if (qh->GOODvertexcxx . . $ qhT#GOODvertex. > 0 && qh->MERGINGcxx . . $ qhT#MERGING.) {
2196 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6151, "qhull input error: 'Qg QVn' (only good vertex) does not work with merging.\nUse 'QJ' to joggle the input or 'Q0' to turn off merging.\n");
2197 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2198 }
2199 if (!(qh->GOODthresholdcxx . . $ qhT#GOODthreshold. || qh->GOODpointcxx . . $ qhT#GOODpoint.
2200 || (!qh->MERGEexactcxx . . $ qhT#MERGEexact. && !qh->PREmergecxx . . $ qhT#PREmerge. && qh->GOODvertexpcxx . . $ qhT#GOODvertexp.))) {
2201 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6152, "qhull input error: 'Qg' (ONLYgood) needs a good threshold('Pd0D0'), a good point(QGn or QG-n), or a good vertex with 'QJ' or 'Q0' (QVn).\n");
2202 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2203 }
2204 if (qh->GOODvertexcxx . . $ qhT#GOODvertex. > 0 && !qh->MERGINGcxx . . $ qhT#MERGING. /* matches qh_partitionall */
2205 && !qh_isvertexcxx . . $ qh_isvertex(51f7266b1cea03d4).(qh->GOODvertexpcxx . . $ qhT#GOODvertexp., vertices)) {
2206 facet= qh_findbestnewcxx . . $ qh_findbestnew(29d444840556a918).(qh, qh->GOODvertexpcxx . . $ qhT#GOODvertexp., qh->facet_listcxx . . $ qhT#facet_list.,
2207 &dist, !qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!, &isoutside, &numpart);
2208 zadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:443:9`!(Zdistgood, numpart);
2209 if (!isoutside) {
2210 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6153, "qhull input error: point for QV%d is inside initial simplex. It can not be made a vertex.\n",
2211 qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, qh->GOODvertexpcxx . . $ qhT#GOODvertexp.));
2212 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2213 }
2214 if (!qh_addpointcxx . . $ qh_addpoint(803c2da44150a732).(qh, qh->GOODvertexpcxx . . $ qhT#GOODvertexp., facet, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!)) {
2215 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &vertices);
2216 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &maxpoints);
2217 return;
2218 }
2219 }
2220 qh_findgoodcxx . . $ qh_findgood(1394db21f60ce6e4).(qh, qh->facet_listcxx . . $ qhT#facet_list., 0);
2221 }
2222 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &vertices);
2223 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &maxpoints);
2224 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1030, "qh_initbuild: initial hull created and points partitioned\n"));
2225 } /* initbuild */
2226
2227 /*-<a href="qh-poly_r.htm#TOC"
2228 >-------------------------------</a><a name="initialhull">-</a>
2229
2230 qh_initialhull(qh, vertices )
2231 constructs the initial hull as a DIM3 simplex of vertices
2232
2233 notes:
2234 only called by qh_initbuild
2235
2236 design:
2237 creates a simplex (initializes lists)
2238 determines orientation of simplex
2239 sets hyperplanes for facets
2240 doubles checks orientation (in case of axis-parallel facets with Gaussian elimination)
2241 checks for flipped facets and qh.NARROWhull
2242 checks the result
2243 */
2244 void qh_initialhullcxx . . $ qh_initialhull(8608e985da769b75).(qhTcxx . . $ qhT# *qh, setTcxx . . $ setT# *vertices) {
2245 facetTcxx . . $ facetT# *facet, *firstfacet, *neighbor, **neighborp;
2246 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! angle, minangle= REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!, dist;
2247
2248 qh_createsimplexcxx . . $ qh_createsimplex(8608e985da769b75).(qh, vertices /* qh.facet_list */);
2249 qh_resetlistscxx . . $ qh_resetlists(10b42c618dd7b8a7).(qh, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, qh_RESETvisiblecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:193:9`!);
2250 qh->facet_nextcxx . . $ qhT#facet_next.= qh->facet_listcxx . . $ qhT#facet_list.; /* advance facet when processed */
2251 qh->interior_pointcxx . . $ qhT#interior_point.= qh_getcentercxx . . $ qh_getcenter(fe0d2af757c5e9f6).(qh, vertices);
2252 if (qh->IStracingcxx . . $ qhT#IStracing.) {
2253 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8105, "qh_initialhull: ");
2254 qh_printpointcxx . . $ qh_printpoint(2a5d8189fef0a50e).(qh, qh->ferrcxx . . $ qhT#ferr., "qh.interior_point", qh->interior_pointcxx . . $ qhT#interior_point.);
2255 }
2256 firstfacet= qh->facet_listcxx . . $ qhT#facet_list.;
2257 qh_setfacetplanecxx . . $ qh_setfacetplane(6436bdf99f629b76).(qh, firstfacet); /* qh_joggle_restart if flipped */
2258 if (firstfacet->flippedcxx . . $ facetT#flipped.) {
2259 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1065, "qh_initialhull: ignore f%d flipped. Test qh.interior_point (p-2) for clearly flipped\n", firstfacet->id));
2260 firstfacet->flippedcxx . . $ facetT#flipped.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2261 }
2262 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zdistcheck);
2263 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, qh->interior_pointcxx . . $ qhT#interior_point., firstfacet, &dist);
2264 if (dist > qh->DISTroundcxx . . $ qhT#DISTround.) { /* clearly flipped */
2265 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1060, "qh_initialhull: initial orientation incorrect, qh.interior_point is %2.2g from f%d. Reversing orientation of all facets\n",
2266 dist, firstfacet->id));
2267 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`!
2268 facet->toporientcxx . . $ facetT#toporient. ^= (unsigned char)Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
2269 qh_setfacetplanecxx . . $ qh_setfacetplane(6436bdf99f629b76).(qh, firstfacet);
2270 }
2271 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
2272 if (facet != firstfacet)
2273 qh_setfacetplanecxx . . $ qh_setfacetplane(6436bdf99f629b76).(qh, facet); /* qh_joggle_restart if flipped */
2274 }
2275 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
2276 if (facet->flippedcxx . . $ facetT#flipped.) {
2277 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1066, "qh_initialhull: ignore f%d flipped. Test qh.interior_point (p-2) for clearly flipped\n", facet->id));
2278 facet->flippedcxx . . $ facetT#flipped.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2279 }
2280 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zdistcheck);
2281 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, qh->interior_pointcxx . . $ qhT#interior_point., facet, &dist); /* duplicates qh_setfacetplane */
2282 if (dist > qh->DISTroundcxx . . $ qhT#DISTround.) { /* clearly flipped, due to axis-parallel facet or coplanar firstfacet */
2283 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1031, "qh_initialhull: initial orientation incorrect, qh.interior_point is %2.2g from f%d. Either axis-parallel facet or coplanar firstfacet f%d. Force outside orientation of all facets\n",
2284 dist, facet->id, firstfacet->id));
2285 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! { /* reuse facet, then 'break' */
2286 facet->flippedcxx . . $ facetT#flipped.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2287 facet->toporientcxx . . $ facetT#toporient. ^= (unsigned char)Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
2288 qh_orientoutsidecxx . . $ qh_orientoutside(c5e9f8858b71e4e4).(qh, facet); /* force outside orientation for f.normal */
2289 }
2290 break;
2291 }
2292 }
2293 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
2294 if (!qh_checkflippedcxx . . $ qh_checkflipped(e8493651136531c1).(qh, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!)) {
2295 if (qh->DELAUNAYcxx . . $ qhT#DELAUNAY. && ! qh->ATinfinitycxx . . $ qhT#ATinfinity.) {
2296 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "initial Delaunay cocircular or cospherical");
2297 if (qh->UPPERdelaunaycxx . . $ qhT#UPPERdelaunay.)
2298 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6240, "Qhull precision error: initial Delaunay input sites are cocircular or cospherical. Option 'Qs' searches all points. Use option 'QJ' to joggle the input, otherwise cannot compute the upper Delaunay triangulation or upper Voronoi diagram of cocircular/cospherical points.\n");
2299 else
2300 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6239, "Qhull precision error: initial Delaunay input sites are cocircular or cospherical. Use option 'Qz' for the Delaunay triangulation or Voronoi diagram of cocircular/cospherical points; it adds a point \"at infinity\". Alternatively use option 'QJ' to joggle the input. Use option 'Qs' to search all points for the initial simplex.\n");
2301 qh_printvertexlistcxx . . $ qh_printvertexlist(1a7a22fa7a4dcf13).(qh, qh->ferrcxx . . $ qhT#ferr., "\ninput sites with last coordinate projected to a paraboloid\n", qh->facet_listcxx . . $ qhT#facet_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!);
2302 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2303 }else {
2304 qh_joggle_restartcxx . . $ qh_joggle_restart(1ce62fb2aa3cd5bf).(qh, "initial simplex is flat");
2305 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6154, "Qhull precision error: Initial simplex is flat (facet %d is coplanar with the interior point)\n",
2306 facet->idcxx . . $ facetT#id.);
2307 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRsingularcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:204:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); /* calls qh_printhelp_singular */
2308 }
2309 }
2310 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facet) {
2311 angle= qh_getanglecxx . . $ qh_getangle(d4434f99f7f8e07d).(qh, facet->normalcxx . . $ facetT#normal., neighbor->normalcxx . . $ facetT#normal.);
2312 minimize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:59:9`!( minangle, angle);
2313 }
2314 }
2315 if (minangle < qh_MAXnarrowcxx . . $ `vendor/qhull/libqhull_r/user_r.h:920:9`! && !qh->NOnarrowcxx . . $ qhT#NOnarrow.) {
2316 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! diff= 1.0 + minangle;
2317
2318 qh->NARROWhullcxx . . $ qhT#NARROWhull.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
2319 qh_optioncxx . . $ qh_option(621c3f0e421c7a14).(qh, "_narrow-hull", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &diff);
2320 if (minangle < qh_WARNnarrowcxx . . $ `vendor/qhull/libqhull_r/user_r.h:932:9`! && !qh->RERUNcxx . . $ qhT#RERUN. && qh->PRINTprecisioncxx . . $ qhT#PRINTprecision.)
2321 qh_printhelp_narrowhullcxx . . $ qh_printhelp_narrowhull(ba8ce234b89861a5).(qh, qh->ferrcxx . . $ qhT#ferr., minangle);
2322 }
2323 zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Zprocessed)= qh->hull_dimcxx . . $ qhT#hull_dim.+1;
2324 qh_checkpolygoncxx . . $ qh_checkpolygon(6436bdf99f629b76).(qh, qh->facet_listcxx . . $ qhT#facet_list.);
2325 qh_checkconvexcxx . . $ qh_checkconvex(3625443eafc1ad63).(qh, qh->facet_listcxx . . $ qhT#facet_list., qh_DATAfaultcxx . . $ `vendor/qhull/libqhull_r/poly_r.h:35:9`!);
2326 if (qh->IStracingcxx . . $ qhT#IStracing. >= 1) {
2327 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8105, "qh_initialhull: simplex constructed\n");
2328 }
2329 } /* initialhull */
2330
2331 /*-<a href="qh-poly_r.htm#TOC"
2332 >-------------------------------</a><a name="initialvertices">-</a>
2333
2334 qh_initialvertices(qh, dim, maxpoints, points, numpoints )
2335 determines a non-singular set of initial vertices
2336 maxpoints may include duplicate points
2337
2338 returns:
2339 temporary set of dim+1 vertices in descending order by vertex id
2340 if qh.RANDOMoutside && !qh.ALLpoints
2341 picks random points
2342 if dim >= qh_INITIALmax,
2343 uses min/max x and max points with non-zero determinants
2344
2345 notes:
2346 unless qh.ALLpoints,
2347 uses maxpoints as long as determinate is non-zero
2348 */
2349 setTcxx . . $ setT# *qh_initialverticescxx . . $ qh_initialvertices(b40444609fbc6c3c).(qhTcxx . . $ qhT# *qh, int dim, setTcxx . . $ setT# *maxpoints, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *points, int numpoints) {
2350 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, **pointp;
2351 setTcxx . . $ setT# *vertices, *simplex, *tested;
2352 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! randr;
2353 int idx, point_i, point_n, k;
2354 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! nearzero= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2355
2356 vertices= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, dim + 1);
2357 simplex= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, dim + 1);
2358 if (qh->ALLpointscxx . . $ qhT#ALLpoints.)
2359 qh_maxsimplexcxx . . $ qh_maxsimplex(3ff2d8979819b0b).(qh, dim, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, points, numpoints, &simplex);
2360 else if (qh->RANDOMoutsidecxx . . $ qhT#RANDOMoutside.) {
2361 while (qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, simplex) != dim+1) {
2362 randr= qh_RANDOMintcxx . . $ `vendor/qhull/libqhull_r/user_r.h:314:9`!;
2363 randr= randr/(qh_RANDOMmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:313:9`!+1);
2364 randr= floor(qh->num_pointscxx . . $ qhT#num_points. * randr);
2365 idx= (int)randr;
2366 while (qh_setincxx . . $ qh_setin(1cb32c02d661274).(simplex, qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, idx))) {
2367 idx++; /* in case qh_RANDOMint always returns the same value */
2368 idx= idx < qh->num_pointscxx . . $ qhT#num_points. ? idx : 0;
2369 }
2370 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &simplex, qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, idx));
2371 }
2372 }else if (qh->hull_dimcxx . . $ qhT#hull_dim. >= qh_INITIALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:461:9`!) {
2373 tested= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, dim+1);
2374 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &simplex, SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(maxpoints)); /* max and min X coord */
2375 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &simplex, SETsecond_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:396:9`!(maxpoints));
2376 qh_maxsimplexcxx . . $ qh_maxsimplex(3ff2d8979819b0b).(qh, fmin_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:43:9`!(qh_INITIALsearchcxx . . $ `vendor/qhull/libqhull_r/user_r.h:449:9`!, dim), maxpoints, points, numpoints, &simplex);
2377 k= qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, simplex);
2378 FOREACHpoint_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1095:9`!(qh, maxpoints) {
2379 if (k >= dim) /* qh_maxsimplex for last point */
2380 break;
2381 if (point_i & 0x1) { /* first try up to dim, max. coord. points */
2382 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(simplex, point) && !qh_setincxx . . $ qh_setin(1cb32c02d661274).(tested, point)){
2383 qh_detsimplexcxx . . $ qh_detsimplex(efb2867cab564b5c).(qh, point, simplex, k, &nearzero);
2384 if (nearzero)
2385 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &tested, point);
2386 else {
2387 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &simplex, point);
2388 k++;
2389 }
2390 }
2391 }
2392 }
2393 FOREACHpoint_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1095:9`!(qh, maxpoints) {
2394 if (k >= dim) /* qh_maxsimplex for last point */
2395 break;
2396 if ((point_i & 0x1) == 0) { /* then test min. coord points */
2397 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(simplex, point) && !qh_setincxx . . $ qh_setin(1cb32c02d661274).(tested, point)){
2398 qh_detsimplexcxx . . $ qh_detsimplex(efb2867cab564b5c).(qh, point, simplex, k, &nearzero);
2399 if (nearzero)
2400 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &tested, point);
2401 else {
2402 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &simplex, point);
2403 k++;
2404 }
2405 }
2406 }
2407 }
2408 /* remove tested points from maxpoints */
2409 FOREACHpoint_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1095:9`!(qh, maxpoints) {
2410 if (qh_setincxx . . $ qh_setin(1cb32c02d661274).(simplex, point) || qh_setincxx . . $ qh_setin(1cb32c02d661274).(tested, point))
2411 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(maxpoints, point_i)= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2412 }
2413 qh_setcompactcxx . . $ qh_setcompact(8608e985da769b75).(qh, maxpoints);
2414 idx= 0;
2415 while (k < dim && (point= qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qh, idx++))) {
2416 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(simplex, point) && !qh_setincxx . . $ qh_setin(1cb32c02d661274).(tested, point)){
2417 qh_detsimplexcxx . . $ qh_detsimplex(efb2867cab564b5c).(qh, point, simplex, k, &nearzero);
2418 if (!nearzero){
2419 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &simplex, point);
2420 k++;
2421 }
2422 }
2423 }
2424 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &tested);
2425 qh_maxsimplexcxx . . $ qh_maxsimplex(3ff2d8979819b0b).(qh, dim, maxpoints, points, numpoints, &simplex);
2426 }else /* qh.hull_dim < qh_INITIALmax */
2427 qh_maxsimplexcxx . . $ qh_maxsimplex(3ff2d8979819b0b).(qh, dim, maxpoints, points, numpoints, &simplex);
2428 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(simplex)
2429 qh_setaddnthcxx . . $ qh_setaddnth(4353c65cb7d1d819).(qh, &vertices, 0, qh_newvertexcxx . . $ qh_newvertex(b0e968ca28a6aec).(qh, point)); /* descending order */
2430 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &simplex);
2431 return vertices;
2432 } /* initialvertices */
2433
2434
2435 /*-<a href="qh-poly_r.htm#TOC"
2436 >-------------------------------</a><a name="isvertex">-</a>
2437
2438 qh_isvertex( point, vertices )
2439 returns vertex if point is in vertex set, else returns NULL
2440
2441 notes:
2442 for qh.GOODvertex
2443 */
2444 vertexTcxx . . $ vertexT# *qh_isvertexcxx . . $ qh_isvertex(51f7266b1cea03d4).(pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, setTcxx . . $ setT# *vertices) {
2445 vertexTcxx . . $ vertexT# *vertex, **vertexp;
2446
2447 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(vertices) {
2448 if (vertex->pointcxx . . $ vertexT#point. == point)
2449 return vertex;
2450 }
2451 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2452 } /* isvertex */
2453
2454 /*-<a href="qh-poly_r.htm#TOC"
2455 >-------------------------------</a><a name="makenewfacets">-</a>
2456
2457 qh_makenewfacets(qh, point )
2458 make new facets from point and qh.visible_list
2459
2460 returns:
2461 apex (point) of the new facets
2462 qh.newfacet_list= list of new facets with hyperplanes and ->newfacet
2463 qh.newvertex_list= list of vertices in new facets with ->newfacet set
2464
2465 if (qh.NEWtentative)
2466 newfacets reference horizon facets, but not vice versa
2467 ridges reference non-simplicial horizon ridges, but not vice versa
2468 does not change existing facets
2469 else
2470 sets qh.NEWfacets
2471 new facets attached to horizon facets and ridges
2472 for visible facets,
2473 visible->r.replace is corresponding new facet
2474
2475 see also:
2476 qh_makenewplanes() -- make hyperplanes for facets
2477 qh_attachnewfacets() -- attachnewfacets if not done here qh->NEWtentative
2478 qh_matchnewfacets() -- match up neighbors
2479 qh_update_vertexneighbors() -- update vertex neighbors and delvertices
2480 qh_deletevisible() -- delete visible facets
2481 qh_checkpolygon() --check the result
2482 qh_triangulate() -- triangulate a non-simplicial facet
2483
2484 design:
2485 for each visible facet
2486 make new facets to its horizon facets
2487 update its f.replace
2488 clear its neighbor set
2489 */
2490 vertexTcxx . . $ vertexT# *qh_makenewfacetscxx . . $ qh_makenewfacets(b0e968ca28a6aec).(qhTcxx . . $ qhT# *qh, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point /* qh.visible_list */) {
2491 facetTcxx . . $ facetT# *visible, *newfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *newfacet2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *neighbor, **neighborp;
2492 vertexTcxx . . $ vertexT# *apex;
2493 int numnew=0;
2494
2495 if (qh->CHECKfrequentlycxx . . $ qhT#CHECKfrequently.) {
2496 qh_checkdelridgecxx . . $ qh_checkdelridge(fb32973c8cc8eae9).(qh);
2497 }
2498 qh->newfacet_listcxx . . $ qhT#newfacet_list.= qh->facet_tailcxx . . $ qhT#facet_tail.;
2499 qh->newvertex_listcxx . . $ qhT#newvertex_list.= qh->vertex_tailcxx . . $ qhT#vertex_tail.;
2500 apex= qh_newvertexcxx . . $ qh_newvertex(b0e968ca28a6aec).(qh, point);
2501 qh_appendvertexcxx . . $ qh_appendvertex(3be63de346aefe7d).(qh, apex);
2502 qh->visit_idcxx . . $ qhT#visit_id.++;
2503 FORALLvisible_facetscxx . . $ `vendor/qhull/libqhull_r/poly_r.h:114:9`! {
2504 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(visible)
2505 neighbor->seencxx . . $ facetT#seen.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2506 if (visible->ridgescxx . . $ facetT#ridges.) {
2507 visible->visitidcxx . . $ facetT#visitid.= qh->visit_idcxx . . $ qhT#visit_id.;
2508 newfacet2= qh_makenew_nonsimplicialcxx . . $ qh_makenew_nonsimplicial(633f8b4f79841835).(qh, visible, apex, &numnew);
2509 }
2510 if (visible->simplicialcxx . . $ facetT#simplicial.)
2511 newfacet= qh_makenew_simplicialcxx . . $ qh_makenew_simplicial(633f8b4f79841835).(qh, visible, apex, &numnew);
2512 if (!qh->NEWtentativecxx . . $ qhT#NEWtentative.) {
2513 if (newfacet2) /* newfacet is null if all ridges defined */
2514 newfacet= newfacet2;
2515 if (newfacet)
2516 visible->fcxx . . $ facetT#f..replacecxx . . $ facetT#$anonymous_type_3#replace.= newfacet;
2517 else
2518 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zinsidevisible);
2519 if (visible->ridgescxx . . $ facetT#ridges.) /* ridges and neighbors are no longer valid for visible facet */
2520 SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(visible->ridges)= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2521 SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(visible->neighbors)= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2522 }
2523 }
2524 if (!qh->NEWtentativecxx . . $ qhT#NEWtentative.)
2525 qh->NEWfacetscxx . . $ qhT#NEWfacets.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
2526 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1032, "qh_makenewfacets: created %d new facets f%d..f%d from point p%d to horizon\n",
2527 numnew, qh->first_newfacet, qh->facet_id-1, qh_pointid(qh, point)));
2528 if (qh->IStracingcxx . . $ qhT#IStracing. >= 4)
2529 qh_printfacetlistcxx . . $ qh_printfacetlist(6a91645e88e2e23a).(qh, qh->newfacet_listcxx . . $ qhT#newfacet_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!);
2530 return apex;
2531 } /* makenewfacets */
2532
2533 #ifndef qh_NOmerge
2534 /*-<a href="qh-poly_r.htm#TOC"
2535 >-------------------------------</a><a name="matchdupridge">-</a>
2536
2537 qh_matchdupridge(qh, atfacet, atskip, hashsize, hashcount )
2538 match duplicate ridges in qh.hash_table for atfacet@atskip
2539 duplicates marked with ->dupridge and qh_DUPLICATEridge
2540
2541 returns:
2542 vertex-facet distance (>0.0) for qh_MERGEridge ridge
2543 updates hashcount
2544 set newfacet, facet, matchfacet's hyperplane (removes from mergecycle of coplanarhorizon facets)
2545
2546 see also:
2547 qh_matchneighbor
2548
2549 notes:
2550 only called by qh_matchnewfacets for qh_buildcone and qh_triangulate_facet
2551 assumes atfacet is simplicial
2552 assumes atfacet->neighbors @ atskip == qh_DUPLICATEridge
2553 usually keeps ridge with the widest merge
2554 both MRGdupridge and MRGflipped are required merges -- rbox 100 C1,2e-13 D4 t1 | qhull d Qbb
2555 can merge flipped f11842 skip 3 into f11862 skip 2 and vice versa (forced by goodmatch/goodmatch2)
2556 blocks -- cannot merge f11862 skip 2 and f11863 skip2 (the widest merge)
2557 must block -- can merge f11843 skip 3 into f11842 flipped skip 3, but not vice versa
2558 can merge f11843 skip 3 into f11863 skip 2, but not vice versa
2559 working/unused.h: [jan'19] Dropped qh_matchdupridge_coplanarhorizon, it was the same or slightly worse. Complex addition, rarely occurs
2560
2561 design:
2562 compute hash value for atfacet and atskip
2563 repeat twice -- once to make best matches, once to match the rest
2564 for each possible facet in qh.hash_table
2565 if it is a matching facet with the same orientation and pass 2
2566 make match
2567 unless tricoplanar, mark match for merging (qh_MERGEridge)
2568 [e.g., tricoplanar RBOX s 1000 t993602376 | QHULL C-1e-3 d Qbb FA Qt]
2569 if it is a matching facet with the same orientation and pass 1
2570 test if this is a better match
2571 if pass 1,
2572 make best match (it will not be merged)
2573 set newfacet, facet, matchfacet's hyperplane (removes from mergecycle of coplanarhorizon facets)
2574
2575 */
2576 coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! qh_matchdupridgecxx . . $ qh_matchdupridge(7b1396f289d61210).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *atfacet, int atskip, int hashsize, int *hashcount) {
2577 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! same, ismatch, isduplicate= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
2578 int hash, scan;
2579 facetTcxx . . $ facetT# *facet, *newfacet, *nextfacet;
2580 facetTcxx . . $ facetT# *maxmatch= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *maxmatch2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *goodmatch= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *goodmatch2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2581 int skip, newskip, nextskip= 0, makematch;
2582 int maxskip= 0, maxskip2= 0, goodskip= 0, goodskip2= 0;
2583 coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! maxdist= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!, maxdist2= 0.0, dupdist, dupdist2, low, high, maxgood, gooddist= 0.0;
2584
2585 maxgood= qh_WIDEdupridgecxx . . $ `vendor/qhull/libqhull_r/user_r.h:971:9`! * (qh->ONEmergecxx . . $ qhT#ONEmerge. + qh->DISTroundcxx . . $ qhT#DISTround.);
2586 hash= qh_gethashcxx . . $ qh_gethash(b9618e642442736e).(qh, hashsize, atfacet->verticescxx . . $ facetT#vertices., qh->hull_dimcxx . . $ qhT#hull_dim., 1,
2587 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(atfacet->vertices, atskip));
2588 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2046, "qh_matchdupridge: find dupridge matches for f%d skip %d hash %d hashcount %d\n",
2589 atfacet->id, atskip, hash, *hashcount));
2590 for (makematch=0; makematch < 2; makematch++) { /* makematch is false on the first pass and 1 on the second */
2591 qh->visit_idcxx . . $ qhT#visit_id.++;
2592 for (newfacet=atfacet, newskip=atskip; newfacet; newfacet= nextfacet, newskip= nextskip) {
2593 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zhashlookup);
2594 nextfacet= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; /* exit when ismatch found */
2595 newfacet->visitidcxx . . $ facetT#visitid.= qh->visit_idcxx . . $ qhT#visit_id.;
2596 for (scan=hash; (facet= SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(qh->hash_table, scan, facetT));
2597 scan= (++scan >= hashsize ? 0 : scan)) {
2598 if (!facet->dupridgecxx . . $ facetT#dupridge. || facet->visitidcxx . . $ facetT#visitid. == qh->visit_idcxx . . $ qhT#visit_id.)
2599 continue;
2600 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zhashtests);
2601 if (qh_matchverticescxx . . $ qh_matchvertices(ff25c79428d3644e).(qh, 1, newfacet->verticescxx . . $ facetT#vertices., newskip, facet->verticescxx . . $ facetT#vertices., &skip, &same)) {
2602 if (SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(newfacet->vertices, newskip) == SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(facet->vertices, skip)) {
2603 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3053, "qh_matchdupridge: duplicate ridge due to duplicate facets (f%d skip %d and f%d skip %d) previously reported as QH7084. Maximize dupdist to force vertex merge\n",
2604 newfacet->id, newskip, facet->id, skip));
2605 isduplicate= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
2606 }
2607 ismatch= (same == (boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`!)(newfacet->toporientcxx . . $ facetT#toporient. ^ facet->toporientcxx . . $ facetT#toporient.));
2608 if (SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(facet->neighbors, skip, facetT) != qh_DUPLICATEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:46:9`!) {
2609 if (!makematch) { /* occurs if many merges, e.g., rbox 100 W0 C2,1e-13 D6 t1546872462 | qhull C0 Qt Tcv */
2610 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6155, "qhull topology error (qh_matchdupridge): missing qh_DUPLICATEridge at f%d skip %d for new f%d skip %d hash %d ismatch %d. Set by qh_matchneighbor\n",
2611 facet->idcxx . . $ facetT#id., skip, newfacet->idcxx . . $ facetT#id., newskip, hash, ismatch);
2612 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRtopologycxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:209:9`!, facet, newfacet);
2613 }
2614 }else if (!ismatch) {
2615 nextfacet= facet;
2616 nextskip= skip;
2617 }else if (SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(newfacet->neighbors, newskip, facetT) == qh_DUPLICATEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:46:9`!) {
2618 if (makematch) {
2619 if (newfacet->tricoplanarcxx . . $ facetT#tricoplanar.) {
2620 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(facet->neighbors, skip)= newfacet;
2621 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(newfacet->neighbors, newskip)= facet;
2622 *hashcount -= 2; /* removed two unmatched facets */
2623 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2075, "qh_matchdupridge: allow tricoplanar dupridge for new f%d skip %d and f%d skip %d\n",
2624 newfacet->id, newskip, facet->id, skip));
2625 }else if (goodmatch && goodmatch2) {
2626 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(goodmatch2->neighbors, goodskip2)= qh_MERGEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:58:9`!; /* undo selection of goodmatch */
2627 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(facet->neighbors, skip)= newfacet;
2628 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(newfacet->neighbors, newskip)= facet;
2629 *hashcount -= 2; /* removed two unmatched facets */
2630 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2105, "qh_matchdupridge: make good forced merge of dupridge f%d skip %d into f%d skip %d, keep new f%d skip %d and f%d skip %d, dist %4.4g\n",
2631 goodmatch->id, goodskip, goodmatch2->id, goodskip2, newfacet->id, newskip, facet->id, skip, gooddist));
2632 goodmatch2= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2633 }else {
2634 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(facet->neighbors, skip)= newfacet;
2635 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(newfacet->neighbors, newskip)= qh_MERGEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:58:9`!; /* resolved by qh_mark_dupridges */
2636 *hashcount -= 2; /* removed two unmatched facets */
2637 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3073, "qh_matchdupridge: make forced merge of dupridge for new f%d skip %d and f%d skip %d, maxdist %4.4g in qh_forcedmerges\n",
2638 newfacet->id, newskip, facet->id, skip, maxdist2));
2639 }
2640 }else { /* !makematch */
2641 if (!facet->normalcxx . . $ facetT#normal.)
2642 qh_setfacetplanecxx . . $ qh_setfacetplane(6436bdf99f629b76).(qh, facet); /* qh_mergecycle will ignore 'mergehorizon' facets with normals, too many cases otherwise */
2643 if (!newfacet->normalcxx . . $ facetT#normal.)
2644 qh_setfacetplanecxx . . $ qh_setfacetplane(6436bdf99f629b76).(qh, newfacet);
2645 dupdist= qh_getdistancecxx . . $ qh_getdistance(9ec7bbcfcdb59ce7).(qh, facet, newfacet, &low, &high); /* ignore low/high */
2646 dupdist2= qh_getdistancecxx . . $ qh_getdistance(9ec7bbcfcdb59ce7).(qh, newfacet, facet, &low, &high);
2647 if (isduplicate) {
2648 goodmatch= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2649 minimize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:59:9`!(dupdist, dupdist2);
2650 maxdist= dupdist;
2651 maxdist2= REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2;
2652 maxmatch= facet;
2653 maxskip= skip;
2654 maxmatch2= newfacet;
2655 maxskip2= newskip;
2656 break; /* force maxmatch */
2657 }else if (facet->flippedcxx . . $ facetT#flipped. && !newfacet->flippedcxx . . $ facetT#flipped. && dupdist < maxgood) {
2658 if (!goodmatch || !goodmatch->flippedcxx . . $ facetT#flipped. || dupdist < gooddist) {
2659 goodmatch= facet;
2660 goodskip= skip;
2661 goodmatch2= newfacet;
2662 goodskip2= newskip;
2663 gooddist= dupdist;
2664 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3070, "qh_matchdupridge: try good dupridge flipped f%d skip %d into new f%d skip %d at dist %2.2g otherdist %2.2g\n",
2665 goodmatch->id, goodskip, goodmatch2->id, goodskip2, gooddist, dupdist2));
2666 }
2667 }else if (newfacet->flippedcxx . . $ facetT#flipped. && !facet->flippedcxx . . $ facetT#flipped. && dupdist2 < maxgood) {
2668 if (!goodmatch || !goodmatch->flippedcxx . . $ facetT#flipped. || dupdist2 < gooddist) {
2669 goodmatch= newfacet;
2670 goodskip= newskip;
2671 goodmatch2= facet;
2672 goodskip2= skip;
2673 gooddist= dupdist2;
2674 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3071, "qh_matchdupridge: try good dupridge flipped new f%d skip %d into f%d skip %d at dist %2.2g otherdist %2.2g\n",
2675 goodmatch->id, goodskip, goodmatch2->id, goodskip2, gooddist, dupdist));
2676 }
2677 }else if (dupdist < maxgood && (!newfacet->flippedcxx . . $ facetT#flipped. || facet->flippedcxx . . $ facetT#flipped.)) { /* disallow not-flipped->flipped */
2678 if (!goodmatch || (!goodmatch->flippedcxx . . $ facetT#flipped. && dupdist < gooddist)) {
2679 goodmatch= facet;
2680 goodskip= skip;
2681 goodmatch2= newfacet;
2682 goodskip2= newskip;
2683 gooddist= dupdist;
2684 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3072, "qh_matchdupridge: try good dupridge f%d skip %d into new f%d skip %d at dist %2.2g otherdist %2.2g\n",
2685 goodmatch->id, goodskip, goodmatch2->id, goodskip2, gooddist, dupdist2));
2686 }
2687 }else if (dupdist2 < maxgood && (!facet->flippedcxx . . $ facetT#flipped. || newfacet->flippedcxx . . $ facetT#flipped.)) { /* disallow not-flipped->flipped */
2688 if (!goodmatch || (!goodmatch->flippedcxx . . $ facetT#flipped. && dupdist2 < gooddist)) {
2689 goodmatch= newfacet;
2690 goodskip= newskip;
2691 goodmatch2= facet;
2692 goodskip2= skip;
2693 gooddist= dupdist2;
2694 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3018, "qh_matchdupridge: try good dupridge new f%d skip %d into f%d skip %d at dist %2.2g otherdist %2.2g\n",
2695 goodmatch->id, goodskip, goodmatch2->id, goodskip2, gooddist, dupdist));
2696 }
2697 }else if (!goodmatch) { /* otherwise match the furthest apart facets */
2698 if (!newfacet->flippedcxx . . $ facetT#flipped. || facet->flippedcxx . . $ facetT#flipped.) {
2699 minimize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:59:9`!(dupdist, dupdist2);
2700 }
2701 if (dupdist > maxdist) { /* could keep !flipped->flipped, but probably lost anyway */
2702 maxdist2= maxdist;
2703 maxdist= dupdist;
2704 maxmatch= facet;
2705 maxskip= skip;
2706 maxmatch2= newfacet;
2707 maxskip2= newskip;
2708 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3055, "qh_matchdupridge: try furthest dupridge f%d skip %d new f%d skip %d at dist %2.2g\n",
2709 maxmatch->id, maxskip, maxmatch2->id, maxskip2, maxdist));
2710 }else if (dupdist > maxdist2)
2711 maxdist2= dupdist;
2712 }
2713 }
2714 }
2715 }
2716 } /* end of foreach entry in qh.hash_table starting at 'hash' */
2717 if (makematch && SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(newfacet->neighbors, newskip, facetT) == qh_DUPLICATEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:46:9`!) {
2718 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6156, "qhull internal error (qh_matchdupridge): no MERGEridge match for dupridge new f%d skip %d at hash %d..%d\n",
2719 newfacet->idcxx . . $ facetT#id., newskip, hash, scan);
2720 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, newfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2721 }
2722 } /* end of foreach newfacet at 'hash' */
2723 if (!makematch) {
2724 if (!maxmatch && !goodmatch) {
2725 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6157, "qhull internal error (qh_matchdupridge): no maximum or good match for dupridge new f%d skip %d at hash %d..%d\n",
2726 atfacet->idcxx . . $ facetT#id., atskip, hash, scan);
2727 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, atfacet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2728 }
2729 if (goodmatch) {
2730 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(goodmatch->neighbors, goodskip)= goodmatch2;
2731 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(goodmatch2->neighbors, goodskip2)= goodmatch;
2732 *hashcount -= 2; /* removed two unmatched facets */
2733 if (goodmatch->flippedcxx . . $ facetT#flipped.) {
2734 if (!goodmatch2->flippedcxx . . $ facetT#flipped.) {
2735 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zflipridge);
2736 }else {
2737 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zflipridge2);
2738 /* qh_joggle_restart called by qh_matchneighbor if qh_DUPLICATEridge */
2739 }
2740 }
2741 /* previously traced */
2742 }else {
2743 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(maxmatch->neighbors, maxskip)= maxmatch2; /* maxmatch!=NULL by QH6157 */
2744 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(maxmatch2->neighbors, maxskip2)= maxmatch;
2745 *hashcount -= 2; /* removed two unmatched facets */
2746 zzinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:424:9`!(Zmultiridge);
2747 /* qh_joggle_restart called by qh_matchneighbor if qh_DUPLICATEridge */
2748 trace0cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:87:9`!((qh, qh->ferr, 25, "qh_matchdupridge: keep dupridge f%d skip %d and f%d skip %d, dist %4.4g\n",
2749 maxmatch2->id, maxskip2, maxmatch->id, maxskip, maxdist));
2750 }
2751 }
2752 }
2753 if (goodmatch)
2754 return gooddist;
2755 return maxdist2;
2756 } /* matchdupridge */
2757
2758 #else /* qh_NOmerge */
2759 coordT qh_matchdupridge(qhT *qh, facetT *atfacet, int atskip, int hashsize, int *hashcount) {
2760 QHULL_UNUSED(qh)
2761 QHULL_UNUSED(atfacet)
2762 QHULL_UNUSED(atskip)
2763 QHULL_UNUSED(hashsize)
2764 QHULL_UNUSED(hashcount)
2765
2766 return 0.0;
2767 }
2768 #endif /* qh_NOmerge */
2769
2770 /*-<a href="qh-poly_r.htm#TOC"
2771 >-------------------------------</a><a name="nearcoplanar">-</a>
2772
2773 qh_nearcoplanar()
2774 for all facets, remove near-inside points from facet->coplanarset</li>
2775 coplanar points defined by innerplane from qh_outerinner()
2776
2777 returns:
2778 if qh->KEEPcoplanar && !qh->KEEPinside
2779 facet->coplanarset only contains coplanar points
2780 if qh.JOGGLEmax
2781 drops inner plane by another qh.JOGGLEmax diagonal since a
2782 vertex could shift out while a coplanar point shifts in
2783
2784 notes:
2785 used for qh.PREmerge and qh.JOGGLEmax
2786 must agree with computation of qh.NEARcoplanar in qh_detroundoff
2787
2788 design:
2789 if not keeping coplanar or inside points
2790 free all coplanar sets
2791 else if not keeping both coplanar and inside points
2792 remove !coplanar or !inside points from coplanar sets
2793 */
2794 void qh_nearcoplanarcxx . . $ qh_nearcoplanar(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh /* qh.facet_list */) {
2795 facetTcxx . . $ facetT# *facet;
2796 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, **pointp;
2797 int numpart;
2798 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist, innerplane;
2799
2800 if (!qh->KEEPcoplanarcxx . . $ qhT#KEEPcoplanar. && !qh->KEEPinsidecxx . . $ qhT#KEEPinside.) {
2801 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
2802 if (facet->coplanarsetcxx . . $ facetT#coplanarset.)
2803 qh_setfreecxx . . $ qh_setfree(8a9e83df9950f349).(qh, &facet->coplanarsetcxx . . $ facetT#coplanarset.);
2804 }
2805 }else if (!qh->KEEPcoplanarcxx . . $ qhT#KEEPcoplanar. || !qh->KEEPinsidecxx . . $ qhT#KEEPinside.) {
2806 qh_outerinnercxx . . $ qh_outerinner(a9d5b3fe0f920222).(qh, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &innerplane);
2807 if (qh->JOGGLEmaxcxx . . $ qhT#JOGGLEmax. < REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2)
2808 innerplane -= qh->JOGGLEmaxcxx . . $ qhT#JOGGLEmax. * sqrt((realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`!)qh->hull_dimcxx . . $ qhT#hull_dim.);
2809 numpart= 0;
2810 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
2811 if (facet->coplanarsetcxx . . $ facetT#coplanarset.) {
2812 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(facet->coplanarset) {
2813 numpart++;
2814 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
2815 if (dist < innerplane) {
2816 if (!qh->KEEPinsidecxx . . $ qhT#KEEPinside.)
2817 SETref_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:335:9`!(point)= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2818 }else if (!qh->KEEPcoplanarcxx . . $ qhT#KEEPcoplanar.)
2819 SETref_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:335:9`!(point)= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
2820 }
2821 qh_setcompactcxx . . $ qh_setcompact(8608e985da769b75).(qh, facet->coplanarsetcxx . . $ facetT#coplanarset.);
2822 }
2823 }
2824 zzadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:437:9`!(Zcheckpart, numpart);
2825 }
2826 } /* nearcoplanar */
2827
2828 /*-<a href="qh-poly_r.htm#TOC"
2829 >-------------------------------</a><a name="nearvertex">-</a>
2830
2831 qh_nearvertex(qh, facet, point, bestdist )
2832 return nearest vertex in facet to point
2833
2834 returns:
2835 vertex and its distance
2836
2837 notes:
2838 if qh.DELAUNAY
2839 distance is measured in the input set
2840 searches neighboring tricoplanar facets (requires vertexneighbors)
2841 Slow implementation. Recomputes vertex set for each point.
2842 The vertex set could be stored in the qh.keepcentrum facet.
2843 */
2844 vertexTcxx . . $ vertexT# *qh_nearvertexcxx . . $ qh_nearvertex(a250672dbb319d8b).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! *bestdistp) {
2845 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! bestdist= REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!, dist;
2846 vertexTcxx . . $ vertexT# *bestvertex= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *vertex, **vertexp, *apex;
2847 coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! *center;
2848 facetTcxx . . $ facetT# *neighbor, **neighborp;
2849 setTcxx . . $ setT# *vertices;
2850 int dim= qh->hull_dimcxx . . $ qhT#hull_dim.;
2851
2852 if (qh->DELAUNAYcxx . . $ qhT#DELAUNAY.)
2853 dim--;
2854 if (facet->tricoplanarcxx . . $ facetT#tricoplanar.) {
2855 if (!qh->VERTEXneighborscxx . . $ qhT#VERTEXneighbors. || !facet->centercxx . . $ facetT#center.) {
2856 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6158, "qhull internal error (qh_nearvertex): qh.VERTEXneighbors and facet->center required for tricoplanar facets\n");
2857 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2858 }
2859 vertices= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, qh->TEMPsizecxx . . $ qhT#TEMPsize.);
2860 apex= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(facet->vertices, vertexT);
2861 center= facet->centercxx . . $ facetT#center.;
2862 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(apex) {
2863 if (neighbor->centercxx . . $ facetT#center. == center) {
2864 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(neighbor->vertices)
2865 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &vertices, vertex);
2866 }
2867 }
2868 }else
2869 vertices= facet->verticescxx . . $ facetT#vertices.;
2870 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(vertices) {
2871 dist= qh_pointdistcxx . . $ qh_pointdist(fcd0cef389fe9aa9).(vertex->pointcxx . . $ vertexT#point., point, -dim);
2872 if (dist < bestdist) {
2873 bestdist= dist;
2874 bestvertex= vertex;
2875 }
2876 }
2877 if (facet->tricoplanarcxx . . $ facetT#tricoplanar.)
2878 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, &vertices);
2879 *bestdistp= sqrt(bestdist);
2880 if (!bestvertex) {
2881 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6261, "qhull internal error (qh_nearvertex): did not find bestvertex for f%d p%d\n", facet->idcxx . . $ facetT#id., qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, point));
2882 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2883 }
2884 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3019, "qh_nearvertex: v%d dist %2.2g for f%d p%d\n",
2885 bestvertex->id, *bestdistp, facet->id, qh_pointid(qh, point))); /* bestvertex!=0 by QH2161 */
2886 return bestvertex;
2887 } /* nearvertex */
2888
2889 /*-<a href="qh-poly_r.htm#TOC"
2890 >-------------------------------</a><a name="newhashtable">-</a>
2891
2892 qh_newhashtable(qh, newsize )
2893 returns size of qh.hash_table of at least newsize slots
2894
2895 notes:
2896 assumes qh.hash_table is NULL
2897 qh_HASHfactor determines the number of extra slots
2898 size is not divisible by 2, 3, or 5
2899 */
2900 int qh_newhashtablecxx . . $ qh_newhashtable(1ab78c06be7805d2).(qhTcxx . . $ qhT# *qh, int newsize) {
2901 int size;
2902
2903 size= ((newsize+1)*qh_HASHfactorcxx . . $ `vendor/qhull/libqhull_r/user_r.h:430:9`!) | 0x1; /* odd number */
2904 while (Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!) {
2905 if (newsize<0 || size<0) {
2906 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->qhmemcxx . . $ qhT#qhmem..ferrcxx . . $ qhmemT#ferr., 6236, "qhull error (qh_newhashtable): negative request (%d) or size (%d). Did int overflow due to high-D?\n", newsize, size); /* WARN64 */
2907 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qhmem_ERRmemcxx . . $ `vendor/qhull/libqhull_r/mem_r.h:72:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2908 }
2909 if ((size%3) && (size%5))
2910 break;
2911 size += 2;
2912 /* loop terminates because there is an infinite number of primes */
2913 }
2914 qh->hash_tablecxx . . $ qhT#hash_table.= qh_setnewcxx . . $ qh_setnew(a2b89a85792cc9f6).(qh, size);
2915 qh_setzerocxx . . $ qh_setzero(7e95d16ebeec0d3b).(qh, qh->hash_tablecxx . . $ qhT#hash_table., 0, size);
2916 return size;
2917 } /* newhashtable */
2918
2919 /*-<a href="qh-poly_r.htm#TOC"
2920 >-------------------------------</a><a name="newvertex">-</a>
2921
2922 qh_newvertex(qh, point )
2923 returns a new vertex for point
2924 */
2925 vertexTcxx . . $ vertexT# *qh_newvertexcxx . . $ qh_newvertex(b0e968ca28a6aec).(qhTcxx . . $ qhT# *qh, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point) {
2926 vertexTcxx . . $ vertexT# *vertex;
2927
2928 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Ztotvertices);
2929 vertex= (vertexTcxx . . $ vertexT# *)qh_memalloccxx . . $ qh_memalloc(b688bd8be61590d5).(qh, (int)sizeof(vertexTcxx . . $ vertexT#));
2930 memsetcxx . . $ memset(d1de1e4fb215f1c6).((char *) vertex, (size_t)0, sizeof(vertexTcxx . . $ vertexT#));
2931 if (qh->vertex_idcxx . . $ qhT#vertex_id. == UINT_MAXcxx . . $ `<external>/67164224788392828/limits.h:124:9`!) {
2932 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, vertex, (int)sizeof(vertexTcxx . . $ vertexT#));
2933 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6159, "qhull error: 2^32 or more vertices. vertexT.id field overflows. Vertices would not be sorted correctly.\n");
2934 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRothercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:208:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
2935 }
2936 if (qh->vertex_idcxx . . $ qhT#vertex_id. == qh->tracevertex_idcxx . . $ qhT#tracevertex_id.)
2937 qh->tracevertexcxx . . $ qhT#tracevertex.= vertex;
2938 vertex->idcxx . . $ vertexT#id.= qh->vertex_idcxx . . $ qhT#vertex_id.++;
2939 vertex->pointcxx . . $ vertexT#point.= point;
2940 trace4cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:91:9`!((qh, qh->ferr, 4060, "qh_newvertex: vertex p%d(v%d) created\n", qh_pointid(qh, vertex->point),
2941 vertex->id));
2942 return(vertex);
2943 } /* newvertex */
2944
2945 /*-<a href="qh-poly_r.htm#TOC"
2946 >-------------------------------</a><a name="nextfacet2d">-</a>
2947
2948 qh_nextfacet2d( facet, &nextvertex )
2949 return next facet and vertex for a 2d facet in qh_ORIENTclock order
2950 returns NULL on error
2951
2952 notes:
2953 in qh_ORIENTclock order (default counter-clockwise)
2954 nextvertex is in between the two facets
2955 does not use qhT or qh_errexit [QhullFacet.cpp]
2956
2957 design:
2958 see io_r.c/qh_printextremes_2d
2959 */
2960 facetTcxx . . $ facetT# *qh_nextfacet2dcxx . . $ qh_nextfacet2d(86ecbca0ef2ac5ce).(facetTcxx . . $ facetT# *facet, vertexTcxx . . $ vertexT# **nextvertexp) {
2961 facetTcxx . . $ facetT# *nextfacet;
2962
2963 if (facet->toporientcxx . . $ facetT#toporient. ^ qh_ORIENTclockcxx . . $ `vendor/qhull/libqhull_r/user_r.h:328:9`!) {
2964 *nextvertexp= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(facet->vertices, vertexT);
2965 nextfacet= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(facet->neighbors, facetT);
2966 }else {
2967 *nextvertexp= SETsecondt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:404:9`!(facet->vertices, vertexT);
2968 nextfacet= SETsecondt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:404:9`!(facet->neighbors, facetT);
2969 }
2970 return nextfacet;
2971 } /* nextfacet2d */
2972
2973 /*-<a href="qh-poly_r.htm#TOC"
2974 >-------------------------------</a><a name="nextridge3d">-</a>
2975
2976 qh_nextridge3d( atridge, facet, &vertex )
2977 return next ridge and vertex for a 3d facet
2978 returns NULL on error
2979 [for QhullFacet::nextRidge3d] Does not call qh_errexit nor access qhT.
2980
2981 notes:
2982 in qh_ORIENTclock order
2983 this is a O(n^2) implementation to trace all ridges
2984 be sure to stop on any 2nd visit
2985 same as QhullRidge::nextRidge3d
2986 does not use qhT or qh_errexit [QhullFacet.cpp]
2987
2988 design:
2989 for each ridge
2990 exit if it is the ridge after atridge
2991 */
2992 ridgeTcxx . . $ ridgeT# *qh_nextridge3dcxx . . $ qh_nextridge3d(89b412cdf82596f4).(ridgeTcxx . . $ ridgeT# *atridge, facetTcxx . . $ facetT# *facet, vertexTcxx . . $ vertexT# **vertexp) {
2993 vertexTcxx . . $ vertexT# *atvertex, *vertex, *othervertex;
2994 ridgeTcxx . . $ ridgeT# *ridge, **ridgep;
2995
2996 if ((atridge->topcxx . . $ ridgeT#top. == facet) ^ qh_ORIENTclockcxx . . $ `vendor/qhull/libqhull_r/user_r.h:328:9`!)
2997 atvertex= SETsecondt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:404:9`!(atridge->vertices, vertexT);
2998 else
2999 atvertex= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(atridge->vertices, vertexT);
3000 FOREACHridge_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1032:9`!(facet->ridges) {
3001 if (ridge == atridge)
3002 continue;
3003 if ((ridge->topcxx . . $ ridgeT#top. == facet) ^ qh_ORIENTclockcxx . . $ `vendor/qhull/libqhull_r/user_r.h:328:9`!) {
3004 othervertex= SETsecondt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:404:9`!(ridge->vertices, vertexT);
3005 vertex= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(ridge->vertices, vertexT);
3006 }else {
3007 vertex= SETsecondt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:404:9`!(ridge->vertices, vertexT);
3008 othervertex= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(ridge->vertices, vertexT);
3009 }
3010 if (vertex == atvertex) {
3011 if (vertexp)
3012 *vertexp= othervertex;
3013 return ridge;
3014 }
3015 }
3016 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3017 } /* nextridge3d */
3018
3019 /*-<a href="qh-poly_r.htm#TOC"
3020 >-------------------------------</a><a name="opposite_vertex">-</a>
3021
3022 qh_opposite_vertex(qh, facetA, neighbor )
3023 return the opposite vertex in facetA to neighbor
3024
3025 */
3026 vertexTcxx . . $ vertexT# *qh_opposite_vertexcxx . . $ qh_opposite_vertex(7cb3df5287517d0e).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetA, facetTcxx . . $ facetT# *neighbor) {
3027 vertexTcxx . . $ vertexT# *opposite= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3028 facetTcxx . . $ facetT# *facet;
3029 int facet_i, facet_n;
3030
3031 if (facetA->simplicialcxx . . $ facetT#simplicial.) {
3032 FOREACHfacet_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1064:9`!(qh, facetA->neighbors) {
3033 if (facet == neighbor) {
3034 opposite= SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(facetA->vertices, facet_i, vertexT);
3035 break;
3036 }
3037 }
3038 }
3039 if (!opposite) {
3040 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6396, "qhull internal error (qh_opposite_vertex): opposite vertex in facet f%d to neighbor f%d is not defined. Either is facet is not simplicial or neighbor not found\n",
3041 facetA->idcxx . . $ facetT#id., neighbor->idcxx . . $ facetT#id.);
3042 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facetA, neighbor);
3043 }
3044 return opposite;
3045 } /* opposite_vertex */
3046
3047 /*-<a href="qh-poly_r.htm#TOC"
3048 >-------------------------------</a><a name="outcoplanar">-</a>
3049
3050 qh_outcoplanar()
3051 move points from all facets' outsidesets to their coplanarsets
3052
3053 notes:
3054 for post-processing under qh.NARROWhull
3055
3056 design:
3057 for each facet
3058 for each outside point for facet
3059 partition point into coplanar set
3060 */
3061 void qh_outcoplanarcxx . . $ qh_outcoplanar(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh /* facet_list */) {
3062 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, **pointp;
3063 facetTcxx . . $ facetT# *facet;
3064 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! dist;
3065
3066 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1033, "qh_outcoplanar: move outsideset to coplanarset for qh->NARROWhull\n"));
3067 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
3068 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(facet->outsideset) {
3069 qh->num_outsidecxx . . $ qhT#num_outside.--;
3070 if (qh->KEEPcoplanarcxx . . $ qhT#KEEPcoplanar. || qh->KEEPnearinsidecxx . . $ qhT#KEEPnearinside.) {
3071 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, point, facet, &dist);
3072 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zpartition);
3073 qh_partitioncoplanarcxx . . $ qh_partitioncoplanar(a0e693a99f1ef15c).(qh, point, facet, &dist, qh->findbestnewcxx . . $ qhT#findbestnew.);
3074 }
3075 }
3076 qh_setfreecxx . . $ qh_setfree(8a9e83df9950f349).(qh, &facet->outsidesetcxx . . $ facetT#outsideset.);
3077 }
3078 } /* outcoplanar */
3079
3080 /*-<a href="qh-poly_r.htm#TOC"
3081 >-------------------------------</a><a name="point">-</a>
3082
3083 qh_point(qh, id )
3084 return point for a point id, or NULL if unknown
3085
3086 alternative code:
3087 return((pointT *)((unsigned long)qh.first_point
3088 + (unsigned long)((id)*qh.normal_size)));
3089 */
3090 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *qh_pointcxx . . $ qh_point(9e7e547d5625316d).(qhTcxx . . $ qhT# *qh, int id) {
3091
3092 if (id < 0)
3093 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3094 if (id < qh->num_pointscxx . . $ qhT#num_points.)
3095 return qh->first_pointcxx . . $ qhT#first_point. + id * qh->hull_dimcxx . . $ qhT#hull_dim.;
3096 id -= qh->num_pointscxx . . $ qhT#num_points.;
3097 if (id < qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->other_pointscxx . . $ qhT#other_points.))
3098 return SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(qh->other_points, id, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`!);
3099 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3100 } /* point */
3101
3102 /*-<a href="qh-poly_r.htm#TOC"
3103 >-------------------------------</a><a name="point_add">-</a>
3104
3105 qh_point_add(qh, set, point, elem )
3106 stores elem at set[point.id]
3107
3108 returns:
3109 access function for qh_pointfacet and qh_pointvertex
3110
3111 notes:
3112 checks point.id
3113 */
3114 void qh_point_addcxx . . $ qh_point_add(2df460ceae9909eb).(qhTcxx . . $ qhT# *qh, setTcxx . . $ setT# *set, pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, void *elem) {
3115 int id, size;
3116
3117 SETreturnsize_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:424:9`!(set, size);
3118 if ((id= qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, point)) < 0)
3119 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 7067, "qhull internal warning (point_add): unknown point %p id %d\n",
3120 (void *) point, id);
3121 else if (id >= size) {
3122 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6160, "qhull internal error (point_add): point p%d is out of bounds(%d)\n",
3123 id, size);
3124 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3125 }else
3126 SETelem_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:347:9`!(set, id)= elem;
3127 } /* point_add */
3128
3129
3130 /*-<a href="qh-poly_r.htm#TOC"
3131 >-------------------------------</a><a name="pointfacet">-</a>
3132
3133 qh_pointfacet()
3134 return temporary set of facet for each point
3135 the set is indexed by point id
3136 at most one facet per point, arbitrary selection
3137
3138 notes:
3139 each point is assigned to at most one of vertices, coplanarset, or outsideset
3140 unassigned points are interior points or
3141 vertices assigned to one of its facets
3142 coplanarset assigned to the facet
3143 outside set assigned to the facet
3144 NULL if no facet for point (inside)
3145 includes qh.GOODpointp
3146
3147 access:
3148 FOREACHfacet_i_(qh, facets) { ... }
3149 SETelem_(facets, i)
3150
3151 design:
3152 for each facet
3153 add each vertex
3154 add each coplanar point
3155 add each outside point
3156 */
3157 setTcxx . . $ setT# *qh_pointfacetcxx . . $ qh_pointfacet(34607698aa694009).(qhTcxx . . $ qhT# *qh /* qh.facet_list */) {
3158 int numpoints= qh->num_pointscxx . . $ qhT#num_points. + qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->other_pointscxx . . $ qhT#other_points.);
3159 setTcxx . . $ setT# *facets;
3160 facetTcxx . . $ facetT# *facet;
3161 vertexTcxx . . $ vertexT# *vertex, **vertexp;
3162 pointTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:105:9`! *point, **pointp;
3163
3164 facets= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, numpoints);
3165 qh_setzerocxx . . $ qh_setzero(7e95d16ebeec0d3b).(qh, facets, 0, numpoints);
3166 qh->vertex_visitcxx . . $ qhT#vertex_visit.++;
3167 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
3168 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices) {
3169 if (vertex->visitidcxx . . $ vertexT#visitid. != qh->vertex_visitcxx . . $ qhT#vertex_visit.) {
3170 vertex->visitidcxx . . $ vertexT#visitid.= qh->vertex_visitcxx . . $ qhT#vertex_visit.;
3171 qh_point_addcxx . . $ qh_point_add(2df460ceae9909eb).(qh, facets, vertex->pointcxx . . $ vertexT#point., facet);
3172 }
3173 }
3174 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(facet->coplanarset)
3175 qh_point_addcxx . . $ qh_point_add(2df460ceae9909eb).(qh, facets, point, facet);
3176 FOREACHpoint_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1015:9`!(facet->outsideset)
3177 qh_point_addcxx . . $ qh_point_add(2df460ceae9909eb).(qh, facets, point, facet);
3178 }
3179 return facets;
3180 } /* pointfacet */
3181
3182 /*-<a href="qh-poly_r.htm#TOC"
3183 >-------------------------------</a><a name="pointvertex">-</a>
3184
3185 qh_pointvertex(qh )
3186 return temporary set of vertices indexed by point id
3187 entry is NULL if no vertex for a point
3188 this will include qh.GOODpointp
3189
3190 access:
3191 FOREACHvertex_i_(qh, vertices) { ... }
3192 SETelem_(vertices, i)
3193 */
3194 setTcxx . . $ setT# *qh_pointvertexcxx . . $ qh_pointvertex(34607698aa694009).(qhTcxx . . $ qhT# *qh /* qh.facet_list */) {
3195 int numpoints= qh->num_pointscxx . . $ qhT#num_points. + qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, qh->other_pointscxx . . $ qhT#other_points.);
3196 setTcxx . . $ setT# *vertices;
3197 vertexTcxx . . $ vertexT# *vertex;
3198
3199 vertices= qh_settempcxx . . $ qh_settemp(a2b89a85792cc9f6).(qh, numpoints);
3200 qh_setzerocxx . . $ qh_setzero(7e95d16ebeec0d3b).(qh, vertices, 0, numpoints);
3201 FORALLverticescxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:961:9`!
3202 qh_point_addcxx . . $ qh_point_add(2df460ceae9909eb).(qh, vertices, vertex->pointcxx . . $ vertexT#point., vertex);
3203 return vertices;
3204 } /* pointvertex */
3205
3206
3207 /*-<a href="qh-poly_r.htm#TOC"
3208 >-------------------------------</a><a name="prependfacet">-</a>
3209
3210 qh_prependfacet(qh, facet, facetlist )
3211 prepend facet to the start of a facetlist
3212
3213 returns:
3214 increments qh.numfacets
3215 updates facetlist, qh.facet_list, facet_next
3216
3217 notes:
3218 be careful of prepending since it can lose a pointer.
3219 e.g., can lose _next by deleting and then prepending before _next
3220 */
3221 void qh_prependfacetcxx . . $ qh_prependfacet(63085aca6d33a107).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet, facetTcxx . . $ facetT# **facetlist) {
3222 facetTcxx . . $ facetT# *prevfacet, *list;
3223
3224 trace4cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:91:9`!((qh, qh->ferr, 4061, "qh_prependfacet: prepend f%d before f%d\n",
3225 facet->id, getid_(*facetlist)));
3226 if (!*facetlist)
3227 (*facetlist)= qh->facet_tailcxx . . $ qhT#facet_tail.;
3228 list= *facetlist;
3229 prevfacet= list->previouscxx . . $ facetT#previous.;
3230 facet->previouscxx . . $ facetT#previous.= prevfacet;
3231 if (prevfacet)
3232 prevfacet->nextcxx . . $ facetT#next.= facet;
3233 list->previouscxx . . $ facetT#previous.= facet;
3234 facet->nextcxx . . $ facetT#next.= *facetlist;
3235 if (qh->facet_listcxx . . $ qhT#facet_list. == list) /* this may change *facetlist */
3236 qh->facet_listcxx . . $ qhT#facet_list.= facet;
3237 if (qh->facet_nextcxx . . $ qhT#facet_next. == list)
3238 qh->facet_nextcxx . . $ qhT#facet_next.= facet;
3239 *facetlist= facet;
3240 qh->num_facetscxx . . $ qhT#num_facets.++;
3241 } /* prependfacet */
3242
3243
3244 /*-<a href="qh-poly_r.htm#TOC"
3245 >-------------------------------</a><a name="printhashtable">-</a>
3246
3247 qh_printhashtable(qh, fp )
3248 print hash table to fp
3249
3250 notes:
3251 not in I/O to avoid bringing io_r.c in
3252
3253 design:
3254 for each hash entry
3255 if defined
3256 if unmatched or will merge (NULL, qh_MERGEridge, qh_DUPLICATEridge)
3257 print entry and neighbors
3258 */
3259 void qh_printhashtablecxx . . $ qh_printhashtable(92be47226f66e56f).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp) {
3260 facetTcxx . . $ facetT# *facet, *neighbor;
3261 int id, facet_i, facet_n, neighbor_i= 0, neighbor_n= 0;
3262 vertexTcxx . . $ vertexT# *vertex, **vertexp;
3263
3264 FOREACHfacet_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1064:9`!(qh, qh->hash_table) {
3265 if (facet) {
3266 FOREACHneighbor_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1080:9`!(qh, facet) {
3267 if (!neighbor || neighbor == qh_MERGEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:58:9`! || neighbor == qh_DUPLICATEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:46:9`!)
3268 break;
3269 }
3270 if (neighbor_i == neighbor_n)
3271 continue;
3272 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9283, "hash %d f%d ", facet_i, facet->idcxx . . $ facetT#id.);
3273 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices)
3274 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9284, "v%d ", vertex->idcxx . . $ vertexT#id.);
3275 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9285, "\n neighbors:");
3276 FOREACHneighbor_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1080:9`!(qh, facet) {
3277 if (neighbor == qh_MERGEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:58:9`!)
3278 id= -3;
3279 else if (neighbor == qh_DUPLICATEridgecxx . . $ `vendor/qhull/libqhull_r/poly_r.h:46:9`!)
3280 id= -2;
3281 else
3282 id= getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(neighbor);
3283 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9286, " %d", id);
3284 }
3285 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9287, "\n");
3286 }
3287 }
3288 } /* printhashtable */
3289
3290 /*-<a href="qh-poly_r.htm#TOC"
3291 >-------------------------------</a><a name="printlists">-</a>
3292
3293 qh_printlists(qh)
3294 print out facet and vertex lists for debugging (without 'f/v' tags)
3295
3296 notes:
3297 not in I/O to avoid bringing io_r.c in
3298 */
3299 void qh_printlistscxx . . $ qh_printlists(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
3300 facetTcxx . . $ facetT# *facet;
3301 vertexTcxx . . $ vertexT# *vertex;
3302 int count= 0;
3303
3304 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 3062, "qh_printlists: max_outside %2.2g all facets:", qh->max_outsidecxx . . $ qhT#max_outside.);
3305 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`!{
3306 if (++count % 100 == 0)
3307 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8109, "\n ");
3308 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8110, " %d", facet->idcxx . . $ facetT#id.);
3309 }
3310 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8111, "\n qh.visible_list f%d, newfacet_list f%d, facet_next f%d for qh_addpoint\n qh.newvertex_list v%d all vertices:",
3311 getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->visible_list), getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newfacet_list), getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->facet_next), getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(qh->newvertex_list));
3312 count= 0;
3313 FORALLverticescxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:961:9`!{
3314 if (++count % 100 == 0)
3315 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8112, "\n ");
3316 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8113, " %d", vertex->idcxx . . $ vertexT#id.);
3317 }
3318 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8114, "\n");
3319 } /* printlists */
3320
3321 /*-<a href="qh-poly.htm#TOC"
3322 >-------------------------------</a><a name="addfacetvertex">-</a>
3323
3324 qh_replacefacetvertex(qh, facet, oldvertex, newvertex )
3325 replace oldvertex with newvertex in f.vertices
3326 vertices are inverse sorted by vertex->id
3327
3328 returns:
3329 toporient is flipped if an odd parity, position change
3330
3331 notes:
3332 for simplicial facets in qh_rename_adjacentvertex
3333 see qh_addfacetvertex
3334 */
3335 void qh_replacefacetvertexcxx . . $ qh_replacefacetvertex(be2ecd9eb4956338).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facet, vertexTcxx . . $ vertexT# *oldvertex, vertexTcxx . . $ vertexT# *newvertex) {
3336 vertexTcxx . . $ vertexT# *vertex;
3337 facetTcxx . . $ facetT# *neighbor;
3338 int vertex_i, vertex_n= 0;
3339 int old_i= -1, new_i= -1;
3340
3341 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3038, "qh_replacefacetvertex: replace v%d with v%d in f%d\n", oldvertex->id, newvertex->id, facet->id));
3342 if (!facet->simplicialcxx . . $ facetT#simplicial.) {
3343 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6283, "qhull internal error (qh_replacefacetvertex): f%d is not simplicial\n", facet->idcxx . . $ facetT#id.);
3344 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3345 }
3346 FOREACHvertex_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1125:9`!(qh, facet->vertices) {
3347 if (new_i == -1 && vertex->idcxx . . $ vertexT#id. < newvertex->idcxx . . $ vertexT#id.) {
3348 new_i= vertex_i;
3349 }else if (vertex->idcxx . . $ vertexT#id. == newvertex->idcxx . . $ vertexT#id.) {
3350 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6281, "qhull internal error (qh_replacefacetvertex): f%d already contains new v%d\n", facet->idcxx . . $ facetT#id., newvertex->idcxx . . $ vertexT#id.);
3351 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3352 }
3353 if (vertex->idcxx . . $ vertexT#id. == oldvertex->idcxx . . $ vertexT#id.) {
3354 old_i= vertex_i;
3355 }
3356 }
3357 if (old_i == -1) {
3358 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6282, "qhull internal error (qh_replacefacetvertex): f%d does not contain old v%d\n", facet->idcxx . . $ facetT#id., oldvertex->idcxx . . $ vertexT#id.);
3359 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3360 }
3361 if (new_i == -1) {
3362 new_i= vertex_n;
3363 }
3364 if (old_i < new_i)
3365 new_i--;
3366 if ((old_i & 0x1) != (new_i & 0x1))
3367 facet->toporientcxx . . $ facetT#toporient. ^= 1;
3368 qh_setdelnthsortedcxx . . $ qh_setdelnthsorted(4711ee2c395cd458).(qh, facet->verticescxx . . $ facetT#vertices., old_i);
3369 qh_setaddnthcxx . . $ qh_setaddnth(4353c65cb7d1d819).(qh, &facet->verticescxx . . $ facetT#vertices., new_i, newvertex);
3370 neighbor= SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(facet->neighbors, old_i, facetT);
3371 qh_setdelnthsortedcxx . . $ qh_setdelnthsorted(4711ee2c395cd458).(qh, facet->neighborscxx . . $ facetT#neighbors., old_i);
3372 qh_setaddnthcxx . . $ qh_setaddnth(4353c65cb7d1d819).(qh, &facet->neighborscxx . . $ facetT#neighbors., new_i, neighbor);
3373 } /* replacefacetvertex */
3374
3375 /*-<a href="qh-poly_r.htm#TOC"
3376 >-------------------------------</a><a name="resetlists">-</a>
3377
3378 qh_resetlists(qh, stats, qh_RESETvisible )
3379 reset newvertex_list, newfacet_list, visible_list, NEWfacets, NEWtentative
3380 if stats,
3381 maintains statistics
3382 if resetVisible,
3383 visible_list is restored to facet_list
3384 otherwise, f.visible/f.replace is retained
3385
3386 returns:
3387 newvertex_list, newfacet_list, visible_list are NULL
3388
3389 notes:
3390 To delete visible facets, call qh_deletevisible before qh_resetlists
3391 */
3392 void qh_resetlistscxx . . $ qh_resetlists(10b42c618dd7b8a7).(qhTcxx . . $ qhT# *qh, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! stats, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! resetVisible /* qh.newvertex_list newfacet_list visible_list */) {
3393 vertexTcxx . . $ vertexT# *vertex;
3394 facetTcxx . . $ facetT# *newfacet, *visible;
3395 int totnew=0, totver=0;
3396
3397 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2066, "qh_resetlists: reset newvertex_list v%d, newfacet_list f%d, visible_list f%d, facet_list f%d next f%d vertex_list v%d -- NEWfacets? %d, NEWtentative? %d, stats? %d\n",
3398 getid_(qh->newvertex_list), getid_(qh->newfacet_list), getid_(qh->visible_list), getid_(qh->facet_list), getid_(qh->facet_next), getid_(qh->vertex_list), qh->NEWfacets, qh->NEWtentative, stats));
3399 if (stats) {
3400 FORALLvertex_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:102:9`!(qh->newvertex_list)
3401 totver++;
3402 FORALLnew_facetscxx . . $ `vendor/qhull/libqhull_r/poly_r.h:90:9`!
3403 totnew++;
3404 zadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:443:9`!(Zvisvertextot, totver);
3405 zmax_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:474:9`!(Zvisvertexmax, totver);
3406 zadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:443:9`!(Znewfacettot, totnew);
3407 zmax_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:474:9`!(Znewfacetmax, totnew);
3408 }
3409 FORALLvertex_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:102:9`!(qh->newvertex_list)
3410 vertex->newfacetcxx . . $ vertexT#newfacet.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3411 qh->newvertex_listcxx . . $ qhT#newvertex_list.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3412 qh->first_newfacetcxx . . $ qhT#first_newfacet.= 0;
3413 FORALLnew_facetscxx . . $ `vendor/qhull/libqhull_r/poly_r.h:90:9`! {
3414 newfacet->newfacetcxx . . $ facetT#newfacet.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3415 newfacet->dupridgecxx . . $ facetT#dupridge.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3416 }
3417 qh->newfacet_listcxx . . $ qhT#newfacet_list.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3418 if (resetVisible) {
3419 FORALLvisible_facetscxx . . $ `vendor/qhull/libqhull_r/poly_r.h:114:9`! {
3420 visible->fcxx . . $ facetT#f..replacecxx . . $ facetT#$anonymous_type_3#replace.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3421 visible->visiblecxx . . $ facetT#visible.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3422 }
3423 qh->num_visiblecxx . . $ qhT#num_visible.= 0;
3424 }
3425 qh->visible_listcxx . . $ qhT#visible_list.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3426 qh->NEWfacetscxx . . $ qhT#NEWfacets.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3427 qh->NEWtentativecxx . . $ qhT#NEWtentative.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3428 } /* resetlists */
3429
3430 /*-<a href="qh-poly_r.htm#TOC"
3431 >-------------------------------</a><a name="setvoronoi_all">-</a>
3432
3433 qh_setvoronoi_all(qh)
3434 compute Voronoi centers for all facets
3435 includes upperDelaunay facets if qh.UPPERdelaunay ('Qu')
3436
3437 returns:
3438 facet->center is the Voronoi center
3439
3440 notes:
3441 unused/untested code: please email [email protected] if this works ok for you
3442
3443 use:
3444 FORALLvertices {...} to locate the vertex for a point.
3445 FOREACHneighbor_(vertex) {...} to visit the Voronoi centers for a Voronoi cell.
3446 */
3447 void qh_setvoronoi_allcxx . . $ qh_setvoronoi_all(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
3448 facetTcxx . . $ facetT# *facet;
3449
3450 qh_clearcenterscxx . . $ qh_clearcenters(9d998a3034dc2f87).(qh, qh_ASvoronoicxx . . $ qh_ASvoronoi.);
3451 qh_vertexneighborscxx . . $ qh_vertexneighbors(fb32973c8cc8eae9).(qh);
3452
3453 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
3454 if (!facet->normalcxx . . $ facetT#normal. || !facet->upperdelaunaycxx . . $ facetT#upperdelaunay. || qh->UPPERdelaunaycxx . . $ qhT#UPPERdelaunay.) {
3455 if (!facet->centercxx . . $ facetT#center.)
3456 facet->centercxx . . $ facetT#center.= qh_facetcentercxx . . $ qh_facetcenter(fe0d2af757c5e9f6).(qh, facet->verticescxx . . $ facetT#vertices.);
3457 }
3458 }
3459 } /* setvoronoi_all */
3460
3461 #ifndef qh_NOmerge
3462 /*-<a href="qh-poly_r.htm#TOC"
3463 >-------------------------------</a><a name="triangulate">-</a>
3464
3465 qh_triangulate()
3466 triangulate non-simplicial facets on qh.facet_list,
3467 if qh->VORONOI, sets Voronoi centers of non-simplicial facets
3468 nop if hasTriangulation
3469
3470 returns:
3471 all facets simplicial
3472 each tricoplanar facet has ->f.triowner == owner of ->center,normal,etc.
3473 resets qh.newfacet_list and visible_list
3474
3475 notes:
3476 called by qh_prepare_output and user_eg2_r.c
3477 call after qh_check_output since may switch to Voronoi centers, and qh_checkconvex skips f.tricoplanar facets
3478 Output may overwrite ->f.triowner with ->f.area
3479 while running, 'triangulated_facet_list' is a list of
3480 one non-simplicial facet followed by its 'f.tricoplanar' triangulated facets
3481 See qh_buildcone
3482 */
3483 void qh_triangulatecxx . . $ qh_triangulate(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh /* qh.facet_list */) {
3484 facetTcxx . . $ facetT# *facet, *nextfacet, *owner;
3485 facetTcxx . . $ facetT# *neighbor, *visible= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *facet1, *facet2, *triangulated_facet_list= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3486 facetTcxx . . $ facetT# *orig_neighbor= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *otherfacet;
3487 vertexTcxx . . $ vertexT# *triangulated_vertex_list= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3488 mergeTcxx . . $ mergeT# *merge;
3489 mergeTypecxx . . $ mergeType# mergetype;
3490 int neighbor_i, neighbor_n;
3491 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! onlygood= qh->ONLYgoodcxx . . $ qhT#ONLYgood.;
3492
3493 if (qh->hasTriangulationcxx . . $ qhT#hasTriangulation.)
3494 return;
3495 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1034, "qh_triangulate: triangulate non-simplicial facets\n"));
3496 if (qh->hull_dimcxx . . $ qhT#hull_dim. == 2)
3497 return;
3498 if (qh->VORONOIcxx . . $ qhT#VORONOI.) { /* otherwise lose Voronoi centers [could rebuild vertex set from tricoplanar] */
3499 qh_clearcenterscxx . . $ qh_clearcenters(9d998a3034dc2f87).(qh, qh_ASvoronoicxx . . $ qh_ASvoronoi.);
3500 qh_vertexneighborscxx . . $ qh_vertexneighbors(fb32973c8cc8eae9).(qh);
3501 }
3502 qh->ONLYgoodcxx . . $ qhT#ONLYgood.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!; /* for makenew_nonsimplicial */
3503 qh->visit_idcxx . . $ qhT#visit_id.++;
3504 qh_initmergesetscxx . . $ qh_initmergesets(fb32973c8cc8eae9).(qh /* qh.facet_mergeset,degen_mergeset,vertex_mergeset */);
3505 qh->newvertex_listcxx . . $ qhT#newvertex_list.= qh->vertex_tailcxx . . $ qhT#vertex_tail.;
3506 for (facet=qh->facet_listcxx . . $ qhT#facet_list.; facet && facet->nextcxx . . $ facetT#next.; facet= nextfacet) { /* non-simplicial facets moved to end */
3507 nextfacet= facet->nextcxx . . $ facetT#next.;
3508 if (facet->visiblecxx . . $ facetT#visible. || facet->simplicialcxx . . $ facetT#simplicial.)
3509 continue;
3510 /* triangulate all non-simplicial facets, otherwise merging does not work, e.g., RBOX c P-0.1 P+0.1 P+0.1 D3 | QHULL d Qt Tv */
3511 if (!triangulated_facet_list)
3512 triangulated_facet_list= facet; /* will be first triangulated facet */
3513 qh_triangulate_facetcxx . . $ qh_triangulate_facet(e3e0c7265c40be2a).(qh, facet, &triangulated_vertex_list); /* qh_resetlists ! */
3514 }
3515 /* qh_checkpolygon invalid due to f.visible without qh.visible_list */
3516 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2047, "qh_triangulate: delete null facets from facetlist f%d. A null facet has the same first (apex) and second vertices\n", getid_(triangulated_facet_list)));
3517 for (facet=triangulated_facet_list; facet && facet->nextcxx . . $ facetT#next.; facet= nextfacet) {
3518 nextfacet= facet->nextcxx . . $ facetT#next.;
3519 if (facet->visiblecxx . . $ facetT#visible.)
3520 continue;
3521 if (facet->ridgescxx . . $ facetT#ridges.) {
3522 if (qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facet->ridgescxx . . $ facetT#ridges.) > 0) {
3523 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6161, "qhull internal error (qh_triangulate): ridges still defined for f%d\n", facet->idcxx . . $ facetT#id.);
3524 qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3525 }
3526 qh_setfreecxx . . $ qh_setfree(8a9e83df9950f349).(qh, &facet->ridgescxx . . $ facetT#ridges.);
3527 }
3528 if (SETfirst_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:378:9`!(facet->vertices) == SETsecond_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:396:9`!(facet->vertices)) {
3529 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Ztrinull);
3530 qh_triangulate_nullcxx . . $ qh_triangulate_null(6436bdf99f629b76).(qh, facet); /* will delete facet */
3531 }
3532 }
3533 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2048, "qh_triangulate: delete %d or more mirrored facets. Mirrored facets have the same vertices due to a null facet\n", qh_setsize(qh, qh->degen_mergeset)));
3534 qh->visible_listcxx . . $ qhT#visible_list.= qh->facet_tailcxx . . $ qhT#facet_tail.;
3535 while ((merge= (mergeTcxx . . $ mergeT# *)qh_setdellastcxx . . $ qh_setdellast(e8c436ef7b70efa7).(qh->degen_mergesetcxx . . $ qhT#degen_mergeset.))) {
3536 facet1= merge->facet1cxx . . $ mergeT#facet1.;
3537 facet2= merge->facet2cxx . . $ mergeT#facet2.;
3538 mergetype= merge->mergetypecxx . . $ mergeT#mergetype.;
3539 qh_memfreecxx . . $ qh_memfree(ba4713d830a38995).(qh, merge, (int)sizeof(mergeTcxx . . $ mergeT#));
3540 if (mergetype == MRGmirrorcxx . . $ MRGmirror.) {
3541 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Ztrimirror);
3542 qh_triangulate_mirrorcxx . . $ qh_triangulate_mirror(6e3cce536604f95a).(qh, facet1, facet2); /* will delete both facets */
3543 }
3544 }
3545 qh_freemergesetscxx . . $ qh_freemergesets(fb32973c8cc8eae9).(qh);
3546 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2049, "qh_triangulate: update neighbor lists for vertices from v%d\n", getid_(triangulated_vertex_list)));
3547 qh->newvertex_listcxx . . $ qhT#newvertex_list.= triangulated_vertex_list; /* all vertices of triangulated facets */
3548 qh->visible_listcxx . . $ qhT#visible_list.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3549 qh_update_vertexneighborscxx . . $ qh_update_vertexneighbors(fb32973c8cc8eae9).(qh /* qh.newvertex_list, empty newfacet_list and visible_list */);
3550 qh_resetlistscxx . . $ qh_resetlists(10b42c618dd7b8a7).(qh, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, !qh_RESETvisiblecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:193:9`! /* qh.newvertex_list, empty newfacet_list and visible_list */);
3551
3552 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2050, "qh_triangulate: identify degenerate tricoplanar facets from f%d\n", getid_(triangulated_facet_list)));
3553 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2051, "qh_triangulate: and replace facet->f.triowner with tricoplanar facets that own center, normal, etc.\n"));
3554 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(triangulated_facet_list) {
3555 if (facet->tricoplanarcxx . . $ facetT#tricoplanar. && !facet->visiblecxx . . $ facetT#visible.) {
3556 FOREACHneighbor_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1080:9`!(qh, facet) {
3557 if (neighbor_i == 0) { /* first iteration */
3558 if (neighbor->tricoplanarcxx . . $ facetT#tricoplanar.)
3559 orig_neighbor= neighbor->fcxx . . $ facetT#f..triownercxx . . $ facetT#$anonymous_type_3#triowner.;
3560 else
3561 orig_neighbor= neighbor;
3562 }else {
3563 if (neighbor->tricoplanarcxx . . $ facetT#tricoplanar.)
3564 otherfacet= neighbor->fcxx . . $ facetT#f..triownercxx . . $ facetT#$anonymous_type_3#triowner.;
3565 else
3566 otherfacet= neighbor;
3567 if (orig_neighbor == otherfacet) {
3568 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Ztridegen);
3569 facet->degeneratecxx . . $ facetT#degenerate.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3570 break;
3571 }
3572 }
3573 }
3574 }
3575 }
3576 if (qh->IStracingcxx . . $ qhT#IStracing. >= 4)
3577 qh_printlistscxx . . $ qh_printlists(fb32973c8cc8eae9).(qh);
3578 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2052, "qh_triangulate: delete visible facets -- non-simplicial, null, and mirrored facets\n"));
3579 owner= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3580 visible= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3581 for (facet=triangulated_facet_list; facet && facet->nextcxx . . $ facetT#next.; facet= nextfacet) {
3582 /* deleting facets, triangulated_facet_list is no longer valid */
3583 nextfacet= facet->nextcxx . . $ facetT#next.;
3584 if (facet->visiblecxx . . $ facetT#visible.) {
3585 if (facet->tricoplanarcxx . . $ facetT#tricoplanar.) { /* a null or mirrored facet */
3586 qh_delfacetcxx . . $ qh_delfacet(6436bdf99f629b76).(qh, facet);
3587 qh->num_visiblecxx . . $ qhT#num_visible.--;
3588 }else { /* a non-simplicial facet followed by its tricoplanars */
3589 if (visible && !owner) {
3590 /* RBOX 200 s D5 t1001471447 | QHULL Qt C-0.01 Qx Qc Tv Qt -- f4483 had 6 vertices/neighbors and 8 ridges */
3591 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2053, "qh_triangulate: delete f%d. All tricoplanar facets degenerate for non-simplicial facet\n",
3592 visible->id));
3593 qh_delfacetcxx . . $ qh_delfacet(6436bdf99f629b76).(qh, visible);
3594 qh->num_visiblecxx . . $ qhT#num_visible.--;
3595 }
3596 visible= facet;
3597 owner= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3598 }
3599 }else if (facet->tricoplanarcxx . . $ facetT#tricoplanar.) {
3600 if (facet->fcxx . . $ facetT#f..triownercxx . . $ facetT#$anonymous_type_3#triowner. != visible || visible==NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
3601 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6162, "qhull internal error (qh_triangulate): tricoplanar facet f%d not owned by its visible, non-simplicial facet f%d\n", facet->idcxx . . $ facetT#id., getid_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:902:9`!(visible));
3602 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facet, visible);
3603 }
3604 if (owner)
3605 facet->fcxx . . $ facetT#f..triownercxx . . $ facetT#$anonymous_type_3#triowner.= owner;
3606 else if (!facet->degeneratecxx . . $ facetT#degenerate.) {
3607 owner= facet;
3608 nextfacet= visible->nextcxx . . $ facetT#next.; /* rescan tricoplanar facets with owner, visible!=0 by QH6162 */
3609 facet->keepcentrumcxx . . $ facetT#keepcentrum.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!; /* one facet owns ->normal, etc. */
3610 facet->coplanarsetcxx . . $ facetT#coplanarset.= visible->coplanarsetcxx . . $ facetT#coplanarset.;
3611 facet->outsidesetcxx . . $ facetT#outsideset.= visible->outsidesetcxx . . $ facetT#outsideset.;
3612 visible->coplanarsetcxx . . $ facetT#coplanarset.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3613 visible->outsidesetcxx . . $ facetT#outsideset.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3614 if (!qh->TRInormalscxx . . $ qhT#TRInormals.) { /* center and normal copied to tricoplanar facets */
3615 visible->centercxx . . $ facetT#center.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3616 visible->normalcxx . . $ facetT#normal.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3617 }
3618 qh_delfacetcxx . . $ qh_delfacet(6436bdf99f629b76).(qh, visible);
3619 qh->num_visiblecxx . . $ qhT#num_visible.--;
3620 }
3621 }
3622 facet->degeneratecxx . . $ facetT#degenerate.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!; /* reset f.degenerate set by qh_triangulate*/
3623 }
3624 if (visible && !owner) {
3625 trace2cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:89:9`!((qh, qh->ferr, 2054, "qh_triangulate: all tricoplanar facets degenerate for last non-simplicial facet f%d\n",
3626 visible->id));
3627 qh_delfacetcxx . . $ qh_delfacet(6436bdf99f629b76).(qh, visible);
3628 qh->num_visiblecxx . . $ qhT#num_visible.--;
3629 }
3630 qh->ONLYgoodcxx . . $ qhT#ONLYgood.= onlygood; /* restore value */
3631 if (qh->CHECKfrequentlycxx . . $ qhT#CHECKfrequently.)
3632 qh_checkpolygoncxx . . $ qh_checkpolygon(6436bdf99f629b76).(qh, qh->facet_listcxx . . $ qhT#facet_list.);
3633 qh->hasTriangulationcxx . . $ qhT#hasTriangulation.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3634 } /* triangulate */
3635
3636
3637 /*-<a href="qh-poly_r.htm#TOC"
3638 >-------------------------------</a><a name="triangulate_facet">-</a>
3639
3640 qh_triangulate_facet(qh, facetA, &firstVertex )
3641 triangulate a non-simplicial facet
3642 if qh.CENTERtype=qh_ASvoronoi, sets its Voronoi center
3643 returns:
3644 qh.newfacet_list == simplicial facets
3645 facet->tricoplanar set and ->keepcentrum false
3646 facet->degenerate set if duplicated apex
3647 facet->f.trivisible set to facetA
3648 facet->center copied from facetA (created if qh_ASvoronoi)
3649 qh_eachvoronoi, qh_detvridge, qh_detvridge3 assume centers copied
3650 facet->normal,offset,maxoutside copied from facetA
3651
3652 notes:
3653 only called by qh_triangulate
3654 qh_makenew_nonsimplicial uses neighbor->seen for the same
3655 if qh.TRInormals, newfacet->normal will need qh_free
3656 if qh.TRInormals and qh_AScentrum, newfacet->center will need qh_free
3657 keepcentrum is also set on Zwidefacet in qh_mergefacet
3658 freed by qh_clearcenters
3659
3660 see also:
3661 qh_addpoint() -- add a point
3662 qh_makenewfacets() -- construct a cone of facets for a new vertex
3663
3664 design:
3665 if qh_ASvoronoi,
3666 compute Voronoi center (facet->center)
3667 select first vertex (highest ID to preserve ID ordering of ->vertices)
3668 triangulate from vertex to ridges
3669 copy facet->center, normal, offset
3670 update vertex neighbors
3671 */
3672 void qh_triangulate_facetcxx . . $ qh_triangulate_facet(e3e0c7265c40be2a).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetA, vertexTcxx . . $ vertexT# **first_vertex) {
3673 facetTcxx . . $ facetT# *newfacet;
3674 facetTcxx . . $ facetT# *neighbor, **neighborp;
3675 vertexTcxx . . $ vertexT# *apex;
3676 int numnew=0;
3677
3678 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3020, "qh_triangulate_facet: triangulate facet f%d\n", facetA->id));
3679
3680 qh->first_newfacetcxx . . $ qhT#first_newfacet.= qh->facet_idcxx . . $ qhT#facet_id.;
3681 if (qh->IStracingcxx . . $ qhT#IStracing. >= 4)
3682 qh_printfacetcxx . . $ qh_printfacet(bc484eec098e5a15).(qh, qh->ferrcxx . . $ qhT#ferr., facetA);
3683 FOREACHneighbor_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:998:9`!(facetA) {
3684 neighbor->seencxx . . $ facetT#seen.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3685 neighbor->coplanarhorizoncxx . . $ facetT#coplanarhorizon.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3686 }
3687 if (qh->CENTERtypecxx . . $ qhT#CENTERtype. == qh_ASvoronoicxx . . $ qh_ASvoronoi. && !facetA->centercxx . . $ facetT#center. /* matches upperdelaunay in qh_setfacetplane() */
3688 && fabs_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:27:9`!(facetA->normal[qh->hull_dim -1]) >= qh->ANGLEroundcxx . . $ qhT#ANGLEround. * qh_ZEROdelaunaycxx . . $ `vendor/qhull/libqhull_r/user_r.h:1030:9`!) {
3689 facetA->centercxx . . $ facetT#center.= qh_facetcentercxx . . $ qh_facetcenter(fe0d2af757c5e9f6).(qh, facetA->verticescxx . . $ facetT#vertices.);
3690 }
3691 qh->visible_listcxx . . $ qhT#visible_list.= qh->newfacet_listcxx . . $ qhT#newfacet_list.= qh->facet_tailcxx . . $ qhT#facet_tail.;
3692 facetA->visitidcxx . . $ facetT#visitid.= qh->visit_idcxx . . $ qhT#visit_id.;
3693 apex= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(facetA->vertices, vertexT);
3694 qh_makenew_nonsimplicialcxx . . $ qh_makenew_nonsimplicial(633f8b4f79841835).(qh, facetA, apex, &numnew);
3695 qh_willdeletecxx . . $ qh_willdelete(6e3cce536604f95a).(qh, facetA, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3696 FORALLnew_facetscxx . . $ `vendor/qhull/libqhull_r/poly_r.h:90:9`! {
3697 newfacet->tricoplanarcxx . . $ facetT#tricoplanar.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3698 newfacet->fcxx . . $ facetT#f..trivisiblecxx . . $ facetT#$anonymous_type_3#trivisible.= facetA;
3699 newfacet->degeneratecxx . . $ facetT#degenerate.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3700 newfacet->upperdelaunaycxx . . $ facetT#upperdelaunay.= facetA->upperdelaunaycxx . . $ facetT#upperdelaunay.;
3701 newfacet->goodcxx . . $ facetT#good.= facetA->goodcxx . . $ facetT#good.;
3702 if (qh->TRInormalscxx . . $ qhT#TRInormals.) { /* 'Q11' triangulate duplicates ->normal and ->center */
3703 newfacet->keepcentrumcxx . . $ facetT#keepcentrum.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3704 if(facetA->normalcxx . . $ facetT#normal.){
3705 newfacet->normalcxx . . $ facetT#normal.= (coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! *)qh_memalloccxx . . $ qh_memalloc(b688bd8be61590d5).(qh, qh->normal_sizecxx . . $ qhT#normal_size.);
3706 memcpycxx . . $ memcpy(cc817cb175f282d).((char *)newfacet->normalcxx . . $ facetT#normal., facetA->normalcxx . . $ facetT#normal., (size_t)qh->normal_sizecxx . . $ qhT#normal_size.);
3707 }
3708 if (qh->CENTERtypecxx . . $ qhT#CENTERtype. == qh_AScentrumcxx . . $ qh_AScentrum.)
3709 newfacet->centercxx . . $ facetT#center.= qh_getcentrumcxx . . $ qh_getcentrum(b7c5d1c2575d3b75).(qh, newfacet);
3710 else if (qh->CENTERtypecxx . . $ qhT#CENTERtype. == qh_ASvoronoicxx . . $ qh_ASvoronoi. && facetA->centercxx . . $ facetT#center.){
3711 newfacet->centercxx . . $ facetT#center.= (coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! *)qh_memalloccxx . . $ qh_memalloc(b688bd8be61590d5).(qh, qh->center_sizecxx . . $ qhT#center_size.);
3712 memcpycxx . . $ memcpy(cc817cb175f282d).((char *)newfacet->centercxx . . $ facetT#center., facetA->centercxx . . $ facetT#center., (size_t)qh->center_sizecxx . . $ qhT#center_size.);
3713 }
3714 }else {
3715 newfacet->keepcentrumcxx . . $ facetT#keepcentrum.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3716 /* one facet will have keepcentrum=True at end of qh_triangulate */
3717 newfacet->normalcxx . . $ facetT#normal.= facetA->normalcxx . . $ facetT#normal.;
3718 newfacet->centercxx . . $ facetT#center.= facetA->centercxx . . $ facetT#center.;
3719 }
3720 newfacet->offsetcxx . . $ facetT#offset.= facetA->offsetcxx . . $ facetT#offset.;
3721 #if qh_MAXoutsidecxx . . $ `vendor/qhull/libqhull_r/user_r.h:589:9`!
3722 newfacet->maxoutsidecxx . . $ facetT#maxoutside.= facetA->maxoutsidecxx . . $ facetT#maxoutside.;
3723 #endif
3724 }
3725 qh_matchnewfacetscxx . . $ qh_matchnewfacets(733abb61795913aa).(qh /* qh.newfacet_list */); /* ignore returned value, maxdupdist */
3726 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Ztricoplanar);
3727 zadd_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:443:9`!(Ztricoplanartot, numnew);
3728 zmax_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:474:9`!(Ztricoplanarmax, numnew);
3729 if (!(*first_vertex))
3730 (*first_vertex)= qh->newvertex_listcxx . . $ qhT#newvertex_list.;
3731 qh->newvertex_listcxx . . $ qhT#newvertex_list.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3732 qh->visible_listcxx . . $ qhT#visible_list.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
3733 /* only update v.neighbors for qh.newfacet_list. qh.visible_list and qh.newvertex_list are NULL */
3734 qh_update_vertexneighborscxx . . $ qh_update_vertexneighbors(fb32973c8cc8eae9).(qh /* qh.newfacet_list */);
3735 qh_resetlistscxx . . $ qh_resetlists(10b42c618dd7b8a7).(qh, Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!, !qh_RESETvisiblecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:193:9`! /* qh.newfacet_list */);
3736 } /* triangulate_facet */
3737
3738 /*-<a href="qh-poly_r.htm#TOC"
3739 >-------------------------------</a><a name="triangulate_link">-</a>
3740
3741 qh_triangulate_link(qh, oldfacetA, facetA, oldfacetB, facetB)
3742 relink facetA to facetB via null oldfacetA or mirrored oldfacetA and oldfacetB
3743 returns:
3744 if neighbors are already linked, will merge as MRGmirror (qh.degen_mergeset, 4-d and up)
3745 */
3746 void qh_triangulate_linkcxx . . $ qh_triangulate_link(7a01bfb1c7da3611).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *oldfacetA, facetTcxx . . $ facetT# *facetA, facetTcxx . . $ facetT# *oldfacetB, facetTcxx . . $ facetT# *facetB) {
3747 int errmirror= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3748
3749 if (oldfacetA == oldfacetB) {
3750 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3052, "qh_triangulate_link: relink neighbors f%d and f%d of null facet f%d\n",
3751 facetA->id, facetB->id, oldfacetA->id));
3752 }else {
3753 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3021, "qh_triangulate_link: relink neighbors f%d and f%d of mirrored facets f%d and f%d\n",
3754 facetA->id, facetB->id, oldfacetA->id, oldfacetB->id));
3755 }
3756 if (qh_setincxx . . $ qh_setin(1cb32c02d661274).(facetA->neighborscxx . . $ facetT#neighbors., facetB)) {
3757 if (!qh_setincxx . . $ qh_setin(1cb32c02d661274).(facetB->neighborscxx . . $ facetT#neighbors., facetA))
3758 errmirror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3759 else if (!facetA->redundantcxx . . $ facetT#redundant. || !facetB->redundantcxx . . $ facetT#redundant. || !qh_hasmergecxx . . $ qh_hasmerge(276e2ed3d95bea80).(qh->degen_mergesetcxx . . $ qhT#degen_mergeset., MRGmirrorcxx . . $ MRGmirror., facetA, facetB))
3760 qh_appendmergesetcxx . . $ qh_appendmergeset(f213644bae32c756).(qh, facetA, facetB, MRGmirrorcxx . . $ MRGmirror., 0.0, 1.0);
3761 }else if (qh_setincxx . . $ qh_setin(1cb32c02d661274).(facetB->neighborscxx . . $ facetT#neighbors., facetA))
3762 errmirror= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3763 if (errmirror) {
3764 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6163, "qhull internal error (qh_triangulate_link): neighbors f%d and f%d do not match for null facet or mirrored facets f%d and f%d\n",
3765 facetA->idcxx . . $ facetT#id., facetB->idcxx . . $ facetT#id., oldfacetA->idcxx . . $ facetT#id., oldfacetB->idcxx . . $ facetT#id.);
3766 qh_errexit2cxx . . $ qh_errexit2(229677952110e8f5).(qh, qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!, facetA, facetB);
3767 }
3768 qh_setreplacecxx . . $ qh_setreplace(e04772c008a00ec4).(qh, facetB->neighborscxx . . $ facetT#neighbors., oldfacetB, facetA);
3769 qh_setreplacecxx . . $ qh_setreplace(e04772c008a00ec4).(qh, facetA->neighborscxx . . $ facetT#neighbors., oldfacetA, facetB);
3770 } /* triangulate_link */
3771
3772 /*-<a href="qh-poly_r.htm#TOC"
3773 >-------------------------------</a><a name="triangulate_mirror">-</a>
3774
3775 qh_triangulate_mirror(qh, facetA, facetB)
3776 delete two mirrored facets identified by qh_triangulate_null() and itself
3777 a mirrored facet shares the same vertices of a logical ridge
3778 design:
3779 since a null facet duplicates the first two vertices, the opposing neighbors absorb the null facet
3780 if they are already neighbors, the opposing neighbors become MRGmirror facets
3781 */
3782 void qh_triangulate_mirrorcxx . . $ qh_triangulate_mirror(6e3cce536604f95a).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetA, facetTcxx . . $ facetT# *facetB) {
3783 facetTcxx . . $ facetT# *neighbor, *neighborB;
3784 int neighbor_i, neighbor_n;
3785
3786 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3022, "qh_triangulate_mirror: delete mirrored facets f%d and f%d and link their neighbors\n",
3787 facetA->id, facetB->id));
3788 FOREACHneighbor_i_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1080:9`!(qh, facetA) {
3789 neighborB= SETelemt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:358:9`!(facetB->neighbors, neighbor_i, facetT);
3790 if (neighbor == facetB && neighborB == facetA)
3791 continue; /* occurs twice */
3792 else if (neighbor->redundantcxx . . $ facetT#redundant. && neighborB->redundantcxx . . $ facetT#redundant.) { /* also mirrored facets (D5+) */
3793 if (qh_hasmergecxx . . $ qh_hasmerge(276e2ed3d95bea80).(qh->degen_mergesetcxx . . $ qhT#degen_mergeset., MRGmirrorcxx . . $ MRGmirror., neighbor, neighborB))
3794 continue;
3795 }
3796 if (neighbor->visiblecxx . . $ facetT#visible. && neighborB->visiblecxx . . $ facetT#visible.) /* previously deleted as mirrored facets */
3797 continue;
3798 qh_triangulate_linkcxx . . $ qh_triangulate_link(7a01bfb1c7da3611).(qh, facetA, neighbor, facetB, neighborB);
3799 }
3800 qh_willdeletecxx . . $ qh_willdelete(6e3cce536604f95a).(qh, facetA, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3801 qh_willdeletecxx . . $ qh_willdelete(6e3cce536604f95a).(qh, facetB, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3802 } /* triangulate_mirror */
3803
3804 /*-<a href="qh-poly_r.htm#TOC"
3805 >-------------------------------</a><a name="triangulate_null">-</a>
3806
3807 qh_triangulate_null(qh, facetA)
3808 remove null facetA from qh_triangulate_facet()
3809 a null facet has vertex #1 (apex) == vertex #2
3810 returns:
3811 adds facetA to ->visible for deletion after qh_update_vertexneighbors
3812 qh->degen_mergeset contains mirror facets (4-d and up only)
3813 design:
3814 since a null facet duplicates the first two vertices, the opposing neighbors absorb the null facet
3815 if they are already neighbors, the opposing neighbors will be merged (MRGmirror)
3816 */
3817 void qh_triangulate_nullcxx . . $ qh_triangulate_null(6436bdf99f629b76).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetA) {
3818 facetTcxx . . $ facetT# *neighbor, *otherfacet;
3819
3820 trace3cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:90:9`!((qh, qh->ferr, 3023, "qh_triangulate_null: delete null facet f%d\n", facetA->id));
3821 neighbor= SETfirstt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:387:9`!(facetA->neighbors, facetT);
3822 otherfacet= SETsecondt_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:404:9`!(facetA->neighbors, facetT);
3823 qh_triangulate_linkcxx . . $ qh_triangulate_link(7a01bfb1c7da3611).(qh, facetA, neighbor, facetA, otherfacet);
3824 qh_willdeletecxx . . $ qh_willdelete(6e3cce536604f95a).(qh, facetA, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
3825 } /* triangulate_null */
3826
3827 #else /* qh_NOmerge */
3828 void qh_triangulate(qhT *qh) {
3829 QHULL_UNUSED(qh)
3830 }
3831 #endif /* qh_NOmerge */
3832
3833 /*-<a href="qh-poly_r.htm#TOC"
3834 >-------------------------------</a><a name="vertexintersect">-</a>
3835
3836 qh_vertexintersect(qh, verticesA, verticesB )
3837 intersects two vertex sets (inverse id ordered)
3838 vertexsetA is a temporary set at the top of qh->qhmem.tempstack
3839
3840 returns:
3841 replaces vertexsetA with the intersection
3842
3843 notes:
3844 only called by qh_neighbor_intersections
3845 if !qh.QHULLfinished, non-simplicial facets may have f.vertices with extraneous vertices
3846 cleaned by qh_remove_extravertices in qh_reduce_vertices
3847 could optimize by overwriting vertexsetA
3848 */
3849 void qh_vertexintersectcxx . . $ qh_vertexintersect(5f861e67ea6df2db).(qhTcxx . . $ qhT# *qh, setTcxx . . $ setT# **vertexsetA, setTcxx . . $ setT# *vertexsetB) {
3850 setTcxx . . $ setT# *intersection;
3851
3852 intersection= qh_vertexintersect_newcxx . . $ qh_vertexintersect_new(32b2859603312e85).(qh, *vertexsetA, vertexsetB);
3853 qh_settempfreecxx . . $ qh_settempfree(8a9e83df9950f349).(qh, vertexsetA);
3854 *vertexsetA= intersection;
3855 qh_settemppushcxx . . $ qh_settemppush(8608e985da769b75).(qh, intersection);
3856 } /* vertexintersect */
3857
3858 /*-<a href="qh-poly_r.htm#TOC"
3859 >-------------------------------</a><a name="vertexintersect_new">-</a>
3860
3861 qh_vertexintersect_new(qh, verticesA, verticesB )
3862 intersects two vertex sets (inverse id ordered)
3863
3864 returns:
3865 a new set
3866
3867 notes:
3868 called by qh_checkfacet, qh_vertexintersect, qh_rename_sharedvertex, qh_findbest_pinchedvertex, qh_neighbor_intersections
3869 if !qh.QHULLfinished, non-simplicial facets may have f.vertices with extraneous vertices
3870 cleaned by qh_remove_extravertices in qh_reduce_vertices
3871 */
3872 setTcxx . . $ setT# *qh_vertexintersect_newcxx . . $ qh_vertexintersect_new(32b2859603312e85).(qhTcxx . . $ qhT# *qh, setTcxx . . $ setT# *vertexsetA, setTcxx . . $ setT# *vertexsetB) {
3873 setTcxx . . $ setT# *intersection= qh_setnewcxx . . $ qh_setnew(a2b89a85792cc9f6).(qh, qh->hull_dimcxx . . $ qhT#hull_dim. - 1);
3874 vertexTcxx . . $ vertexT# **vertexA= SETaddr_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:412:9`!(vertexsetA, vertexT);
3875 vertexTcxx . . $ vertexT# **vertexB= SETaddr_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:412:9`!(vertexsetB, vertexT);
3876
3877 while (*vertexA && *vertexB) {
3878 if (*vertexA == *vertexB) {
3879 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &intersection, *vertexA);
3880 vertexA++; vertexB++;
3881 }else {
3882 if ((*vertexA)->idcxx . . $ vertexT#id. > (*vertexB)->idcxx . . $ vertexT#id.)
3883 vertexA++;
3884 else
3885 vertexB++;
3886 }
3887 }
3888 return intersection;
3889 } /* vertexintersect_new */
3890
3891 /*-<a href="qh-poly_r.htm#TOC"
3892 >-------------------------------</a><a name="vertexneighbors">-</a>
3893
3894 qh_vertexneighbors(qh)
3895 for each vertex in qh.facet_list,
3896 determine its neighboring facets
3897
3898 returns:
3899 sets qh.VERTEXneighbors
3900 nop if qh.VERTEXneighbors already set
3901 qh_addpoint() will maintain them
3902
3903 notes:
3904 assumes all vertex->neighbors are NULL
3905
3906 design:
3907 for each facet
3908 for each vertex
3909 append facet to vertex->neighbors
3910 */
3911 void qh_vertexneighborscxx . . $ qh_vertexneighbors(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh /* qh.facet_list */) {
3912 facetTcxx . . $ facetT# *facet;
3913 vertexTcxx . . $ vertexT# *vertex, **vertexp;
3914
3915 if (qh->VERTEXneighborscxx . . $ qhT#VERTEXneighbors.)
3916 return;
3917 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1035, "qh_vertexneighbors: determining neighboring facets for each vertex\n"));
3918 qh->vertex_visitcxx . . $ qhT#vertex_visit.++;
3919 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
3920 if (facet->visiblecxx . . $ facetT#visible.)
3921 continue;
3922 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices) {
3923 if (vertex->visitidcxx . . $ vertexT#visitid. != qh->vertex_visitcxx . . $ qhT#vertex_visit.) {
3924 vertex->visitidcxx . . $ vertexT#visitid.= qh->vertex_visitcxx . . $ qhT#vertex_visit.;
3925 vertex->neighborscxx . . $ vertexT#neighbors.= qh_setnewcxx . . $ qh_setnew(a2b89a85792cc9f6).(qh, qh->hull_dimcxx . . $ qhT#hull_dim.);
3926 }
3927 qh_setappendcxx . . $ qh_setappend(7d4389bcfd90c694).(qh, &vertex->neighborscxx . . $ vertexT#neighbors., facet);
3928 }
3929 }
3930 qh->VERTEXneighborscxx . . $ qhT#VERTEXneighbors.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3931 } /* vertexneighbors */
3932
3933 /*-<a href="qh-poly_r.htm#TOC"
3934 >-------------------------------</a><a name="vertexsubset">-</a>
3935
3936 qh_vertexsubset( vertexsetA, vertexsetB )
3937 returns True if vertexsetA is a subset of vertexsetB
3938 assumes vertexsets are sorted
3939
3940 note:
3941 empty set is a subset of any other set
3942 */
3943 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! qh_vertexsubsetcxx . . $ qh_vertexsubset(379353bd42340fc5).(setTcxx . . $ setT# *vertexsetA, setTcxx . . $ setT# *vertexsetB) {
3944 vertexTcxx . . $ vertexT# **vertexA= (vertexTcxx . . $ vertexT# **) SETaddr_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:412:9`!(vertexsetA, vertexT);
3945 vertexTcxx . . $ vertexT# **vertexB= (vertexTcxx . . $ vertexT# **) SETaddr_cxx . . $ `vendor/qhull/libqhull_r/qset_r.h:412:9`!(vertexsetB, vertexT);
3946
3947 while (Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!) {
3948 if (!*vertexA)
3949 return Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
3950 if (!*vertexB)
3951 return Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3952 if ((*vertexA)->idcxx . . $ vertexT#id. > (*vertexB)->idcxx . . $ vertexT#id.)
3953 return Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
3954 if (*vertexA == *vertexB)
3955 vertexA++;
3956 vertexB++;
3957 }
3958 return Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!; /* avoid warnings */
3959 } /* vertexsubset */