1
/*<html><pre> -<a href="qh-user.htm"
2
>-------------------------------</a><a name="TOP">-</a>
5
user redefinable constants
7
see qh-user.htm. see COPYING for copyright information.
9
before reading any code, review libqhull.h for data structure definitions and
13
============= qhull library constants ======================
14
============= data types and configuration macros ==========
15
============= performance related constants ================
16
============= memory constants =============================
17
============= joggle constants =============================
18
============= conditional compilation ======================
19
============= -merge constants- ============================
22
NOerrors -- the code does not call qh_errexit()
23
WARN64 -- the code may be incompatible with 64-bit pointers
32
/*============================================================*/
33
/*============= qhull library constants ======================*/
34
/*============================================================*/
36
/*-<a href="qh-user.htm#TOC"
37
>--------------------------------</a><a name="filenamelen">-</a>
39
FILENAMElen -- max length for TI and TO filenames
43
#define qh_FILENAMElen 500
45
/*-<a href="qh-user.htm#TOC"
46
>--------------------------------</a><a name="msgcode">-</a>
48
msgcode -- Unique message codes for qh_fprintf
50
If add new messages, assign these values and increment.
52
def counters = [27, 1047, 2059, 3025, 4068, 5003,
53
6241, 7079, 8143, 9410, 10000, 11026]
55
See: qh_ERR* [libqhull.h]
59
#define MSG_TRACE1 1000
60
#define MSG_TRACE2 2000
61
#define MSG_TRACE3 3000
62
#define MSG_TRACE4 4000
63
#define MSG_TRACE5 5000
64
#define MSG_ERROR 6000 /* errors written to qh.ferr */
65
#define MSG_WARNING 7000
66
#define MSG_STDERR 8000 /* log messages Written to qh.ferr */
67
#define MSG_OUTPUT 9000
68
#define MSG_QHULL_ERROR 10000 /* errors thrown by QhullError [QhullError.h] */
69
#define MSG_FIXUP 11000 /* FIXUP QH11... */
70
#define MSG_MAXLEN 3000 /* qh_printhelp_degenerate() in user.c */
73
/*-<a href="qh-user.htm#TOC"
74
>--------------------------------</a><a name="qh_OPTIONline">-</a>
76
qh_OPTIONline -- max length of an option line 'FO'
78
#define qh_OPTIONline 80
80
/*============================================================*/
81
/*============= data types and configuration macros ==========*/
82
/*============================================================*/
84
/*-<a href="qh-user.htm#TOC"
85
>--------------------------------</a><a name="realT">-</a>
88
set the size of floating point numbers
91
maximimum number of significant digits
93
qh_REAL_1, qh_REAL_2n, qh_REAL_3n
94
format strings for printf
96
qh_REALmax, qh_REALmin
97
maximum and minimum (near zero) values
100
machine roundoff. Maximum roundoff error for addition and multiplication.
103
Select whether to store floating point numbers in single precision (float)
104
or double precision (double).
106
Use 'float' to save about 8% in time and 25% in space. This is particularly
107
helpful if high-d where convex hulls are space limited. Using 'float' also
108
reduces the printed size of Qhull's output since numbers have 8 digits of
111
Use 'double' when greater arithmetic precision is needed. This is needed
112
for Delaunay triangulations and Voronoi diagrams when you are not merging
115
If 'double' gives insufficient precision, your data probably includes
116
degeneracies. If so you should use facet merging (done by default)
117
or exact arithmetic (see imprecision section of manual, qh-impre.htm).
118
You may also use option 'Po' to force output despite precision errors.
120
You may use 'long double', but many format statements need to be changed
121
and you may need a 'long double' square root routine. S. Grundmann
122
(sg@eeiwzb.et.tu-dresden.de) has done this. He reports that the code runs
123
much slower with little gain in precision.
125
WARNING: on some machines, int f(){realT a= REALmax;return (a == REALmax);}
126
returns False. Use (a > REALmax/2) instead of (a == REALmax).
128
REALfloat = 1 all numbers are 'float' type
129
= 0 all numbers are 'double' type
135
#define REALmax FLT_MAX
136
#define REALmin FLT_MIN
137
#define REALepsilon FLT_EPSILON
138
#define qh_REALdigits 8 /* maximum number of significant digits */
139
#define qh_REAL_1 "%6.8g "
140
#define qh_REAL_2n "%6.8g %6.8g\n"
141
#define qh_REAL_3n "%6.8g %6.8g %6.8g\n"
143
#elif (REALfloat == 0)
145
#define REALmax DBL_MAX
146
#define REALmin DBL_MIN
147
#define REALepsilon DBL_EPSILON
148
#define qh_REALdigits 16 /* maximum number of significant digits */
149
#define qh_REAL_1 "%6.16g "
150
#define qh_REAL_2n "%6.16g %6.16g\n"
151
#define qh_REAL_3n "%6.16g %6.16g %6.16g\n"
154
#error unknown float option
157
/*-<a href="qh-user.htm#TOC"
158
>--------------------------------</a><a name="CPUclock">-</a>
161
define the clock() function for reporting the total time spent by Qhull
162
returns CPU ticks as a 'long int'
163
qh_CPUclock is only used for reporting the total time spent by Qhull
166
the number of clock ticks per second
169
looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds
170
to define a custom clock, set qh_CLOCKtype to 0
172
if your system does not use clock() to return CPU ticks, replace
173
qh_CPUclock with the corresponding function. It is converted
174
to 'unsigned long' to prevent wrap-around during long runs. By default,
175
<time.h> defines clock_t as 'long'
179
1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond
180
Note: may fail if more than 1 hour elapsed time
182
2 use qh_clock() with POSIX times() (see global.c)
184
#define qh_CLOCKtype 1 /* change to the desired number */
186
#if (qh_CLOCKtype == 1)
188
#if defined(CLOCKS_PER_SECOND)
189
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
190
#define qh_SECticks CLOCKS_PER_SECOND
192
#elif defined(CLOCKS_PER_SEC)
193
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
194
#define qh_SECticks CLOCKS_PER_SEC
196
#elif defined(CLK_TCK)
197
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
198
#define qh_SECticks CLK_TCK
201
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
202
#define qh_SECticks 1E6
205
#elif (qh_CLOCKtype == 2)
206
#define qh_CPUclock qh_clock() /* return CPU clock */
207
#define qh_SECticks 100
209
#else /* qh_CLOCKtype == ? */
210
#error unknown clock option
213
/*-<a href="qh-user.htm#TOC"
214
>--------------------------------</a><a name="RANDOM">-</a>
216
qh_RANDOMtype, qh_RANDOMmax, qh_RANDOMseed
217
define random number generator
219
qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax.
220
qh_RANDOMseed sets the random number seed for qh_RANDOMint
222
Set qh_RANDOMtype (default 5) to:
223
1 for random() with 31 bits (UCB)
224
2 for rand() with RAND_MAX or 15 bits (system 5)
225
3 for rand() with 31 bits (Sun)
226
4 for lrand48() with 31 bits (Solaris)
227
5 for qh_rand() with 31 bits (included with Qhull)
230
Random numbers are used by rbox to generate point sets. Random
231
numbers are used by Qhull to rotate the input ('QRn' option),
232
simulate a randomized algorithm ('Qr' option), and to simulate
233
roundoff errors ('Rn' option).
235
Random number generators differ between systems. Most systems provide
236
rand() but the period varies. The period of rand() is not critical
237
since qhull does not normally use random numbers.
239
The default generator is Park & Miller's minimal standard random
240
number generator [CACM 31:1195 '88]. It is included with Qhull.
242
If qh_RANDOMmax is wrong, qhull will report a warning and Geomview
243
output will likely be invisible.
245
#define qh_RANDOMtype 5 /* *** change to the desired number *** */
247
#if (qh_RANDOMtype == 1)
248
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, random()/MAX */
249
#define qh_RANDOMint random()
250
#define qh_RANDOMseed_(seed) srandom(seed);
252
#elif (qh_RANDOMtype == 2)
254
#define qh_RANDOMmax ((realT)RAND_MAX)
256
#define qh_RANDOMmax ((realT)32767) /* 15 bits (System 5) */
258
#define qh_RANDOMint rand()
259
#define qh_RANDOMseed_(seed) srand((unsigned)seed);
261
#elif (qh_RANDOMtype == 3)
262
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, Sun */
263
#define qh_RANDOMint rand()
264
#define qh_RANDOMseed_(seed) srand((unsigned)seed);
266
#elif (qh_RANDOMtype == 4)
267
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, lrand38()/MAX */
268
#define qh_RANDOMint lrand48()
269
#define qh_RANDOMseed_(seed) srand48(seed);
271
#elif (qh_RANDOMtype == 5)
272
#define qh_RANDOMmax ((realT)2147483646UL) /* 31 bits, qh_rand/MAX */
273
#define qh_RANDOMint qh_rand()
274
#define qh_RANDOMseed_(seed) qh_srand(seed);
275
/* unlike rand(), never returns 0 */
278
#error: unknown random option
281
/*-<a href="qh-user.htm#TOC"
282
>--------------------------------</a><a name="ORIENTclock">-</a>
285
0 for inward pointing normals by Geomview convention
287
#define qh_ORIENTclock 0
290
/*============================================================*/
291
/*============= joggle constants =============================*/
292
/*============================================================*/
294
/*-<a href="qh-user.htm#TOC"
295
>--------------------------------</a><a name="JOGGLEdefault">-</a>
298
default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault
301
rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-16
302
rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults
303
rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults
304
rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults
305
rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults
306
rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults
307
rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults
308
rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults
309
rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults
310
the later have about 20 points per facet, each of which may interfere
312
pick a value large enough to avoid retries on most inputs
314
#define qh_JOGGLEdefault 30000.0
316
/*-<a href="qh-user.htm#TOC"
317
>--------------------------------</a><a name="JOGGLEincrease">-</a>
320
factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain
322
#define qh_JOGGLEincrease 10.0
324
/*-<a href="qh-user.htm#TOC"
325
>--------------------------------</a><a name="JOGGLEretry">-</a>
328
if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax
331
try twice at the original value in case of bad luck the first time
333
#define qh_JOGGLEretry 2
335
/*-<a href="qh-user.htm#TOC"
336
>--------------------------------</a><a name="JOGGLEagain">-</a>
339
every following qh_JOGGLEagain, increase qh.JOGGLEmax
342
1 is OK since it's already failed qh_JOGGLEretry times
344
#define qh_JOGGLEagain 1
346
/*-<a href="qh-user.htm#TOC"
347
>--------------------------------</a><a name="JOGGLEmaxincrease">-</a>
350
maximum qh.JOGGLEmax due to qh_JOGGLEincrease
351
relative to qh.MAXwidth
354
qh.joggleinput will retry at this value until qh_JOGGLEmaxretry
356
#define qh_JOGGLEmaxincrease 1e-2
358
/*-<a href="qh-user.htm#TOC"
359
>--------------------------------</a><a name="JOGGLEmaxretry">-</a>
362
stop after qh_JOGGLEmaxretry attempts
364
#define qh_JOGGLEmaxretry 100
366
/*============================================================*/
367
/*============= performance related constants ================*/
368
/*============================================================*/
370
/*-<a href="qh-user.htm#TOC"
371
>--------------------------------</a><a name="HASHfactor">-</a>
374
total hash slots / used hash slots. Must be at least 1.1.
377
=2 for at worst 50% occupancy for qh hash_table and normally 25% occupancy
379
#define qh_HASHfactor 2
381
/*-<a href="qh-user.htm#TOC"
382
>--------------------------------</a><a name="VERIFYdirect">-</a>
385
with 'Tv' verify all points against all facets if op count is smaller
388
if greater, calls qh_check_bestdist() instead
390
#define qh_VERIFYdirect 1000000
392
/*-<a href="qh-user.htm#TOC"
393
>--------------------------------</a><a name="INITIALsearch">-</a>
396
if qh_INITIALmax, search points up to this dimension
398
#define qh_INITIALsearch 6
400
/*-<a href="qh-user.htm#TOC"
401
>--------------------------------</a><a name="INITIALmax">-</a>
404
if dim >= qh_INITIALmax, use min/max coordinate points for initial simplex
407
from points with non-zero determinants
408
use option 'Qs' to override (much slower)
410
#define qh_INITIALmax 8
412
/*============================================================*/
413
/*============= memory constants =============================*/
414
/*============================================================*/
416
/*-<a href="qh-user.htm#TOC"
417
>--------------------------------</a><a name="MEMalign">-</a>
420
memory alignment for qh_meminitbuffers() in global.c
423
to avoid bus errors, memory allocation must consider alignment requirements.
424
malloc() automatically takes care of alignment. Since mem.c manages
425
its own memory, we need to explicitly specify alignment in
428
A safe choice is sizeof(double). sizeof(float) may be used if doubles
429
do not occur in data structures and pointers are the same size. Be careful
430
of machines (e.g., DEC Alpha) with large pointers.
432
If using gcc, best alignment is
433
#define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *))
435
#define qh_MEMalign ((int)(fmax_(sizeof(realT), sizeof(void *))))
437
/*-<a href="qh-user.htm#TOC"
438
>--------------------------------</a><a name="MEMbufsize">-</a>
441
size of additional memory buffers
444
used for qh_meminitbuffers() in global.c
446
#define qh_MEMbufsize 0x10000 /* allocate 64K memory buffers */
448
/*-<a href="qh-user.htm#TOC"
449
>--------------------------------</a><a name="MEMinitbuf">-</a>
452
size of initial memory buffer
455
use for qh_meminitbuffers() in global.c
457
#define qh_MEMinitbuf 0x20000 /* initially allocate 128K buffer */
459
/*-<a href="qh-user.htm#TOC"
460
>--------------------------------</a><a name="INFINITE">-</a>
463
on output, indicates Voronoi center at infinity
465
#define qh_INFINITE -10.101
467
/*-<a href="qh-user.htm#TOC"
468
>--------------------------------</a><a name="DEFAULTbox">-</a>
471
default box size (Geomview expects 0.5)
474
default box size for integer coorindate (rbox only)
476
#define qh_DEFAULTbox 0.5
477
#define qh_DEFAULTzbox 1e6
479
/*============================================================*/
480
/*============= conditional compilation ======================*/
481
/*============================================================*/
483
/*-<a href="qh-user.htm#TOC"
484
>--------------------------------</a><a name="compiler">-</a>
487
defined by C++ compilers
490
defined by Microsoft Visual C++
492
__MWERKS__ && __POWERPC__
493
defined by Metrowerks when compiling for the Power Macintosh
496
defined for strict ANSI C
499
/*-<a href="qh-user.htm#TOC"
500
>--------------------------------</a><a name="COMPUTEfurthest">-</a>
503
compute furthest distance to an outside point instead of storing it with the facet
504
=1 to compute furthest
507
computing furthest saves memory but costs time
508
about 40% more distance tests for partitioning
509
removes facet->furthestdist
511
#define qh_COMPUTEfurthest 0
513
/*-<a href="qh-user.htm#TOC"
514
>--------------------------------</a><a name="KEEPstatistics">-</a>
517
=0 removes most of statistic gathering and reporting
520
if 0, code size is reduced by about 4%.
522
#define qh_KEEPstatistics 1
524
/*-<a href="qh-user.htm#TOC"
525
>--------------------------------</a><a name="MAXoutside">-</a>
528
record outer plane for each facet
529
=1 to record facet->maxoutside
532
this takes a realT per facet and slightly slows down qhull
533
it produces better outer planes for geomview output
535
#define qh_MAXoutside 1
537
/*-<a href="qh-user.htm#TOC"
538
>--------------------------------</a><a name="NOmerge">-</a>
541
disables facet merging if defined
544
This saves about 10% space.
547
qh_NOmerge sets 'QJ' to avoid precision errors
552
<a href="mem.h#NOmem">qh_NOmem</a> in mem.c
554
see user.c/user_eg.c for removing io.o
557
/*-<a href="qh-user.htm#TOC"
558
>--------------------------------</a><a name="NOtrace">-</a>
561
no tracing if defined
564
This saves about 5% space.
569
/*-<a href="qh-user.htm#TOC"
570
>--------------------------------</a><a name="QHpointer">-</a>
573
access global data with pointer or static structure
575
qh_QHpointer = 1 access globals via a pointer to allocated memory
576
enables qh_saveqhull() and qh_restoreqhull()
577
[2010, gcc] costs about 4% in time and 4% in space
578
[2003, msvc] costs about 8% in time and 2% in space
580
= 0 qh_qh and qh_qhstat are static data structures
581
only one instance of qhull() can be active at a time
584
qh_QHpointer_dllimport and qh_dllimport define qh_qh as __declspec(dllimport) [libqhull.h]
585
It is required for msvc-2005. It is not needed for gcc.
588
all global variables for qhull are in qh, qhmem, and qhstat
589
qh is defined in libqhull.h
590
qhmem is defined in mem.h
591
qhstat is defined in stat.h
592
C++ build defines qh_QHpointer [libqhullp.pro, libqhullcpp.pro]
595
user_eg.c for an example
599
#error QH6207 Qhull error: Use qh_QHpointer_dllimport instead of qh_dllimport with qh_QHpointer
602
#define qh_QHpointer 0
603
#if qh_QHpointer_dllimport
604
#error QH6234 Qhull error: Use qh_dllimport instead of qh_QHpointer_dllimport when qh_QHpointer is not defined
607
#if 0 /* sample code */
608
qhT *oldqhA, *oldqhB;
610
exitcode= qh_new_qhull(dim, numpoints, points, ismalloc,
611
flags, outfile, errfile);
612
/* use results from first call to qh_new_qhull */
613
oldqhA= qh_save_qhull();
614
exitcode= qh_new_qhull(dimB, numpointsB, pointsB, ismalloc,
615
flags, outfile, errfile);
616
/* use results from second call to qh_new_qhull */
617
oldqhB= qh_save_qhull();
618
qh_restore_qhull(&oldqhA);
619
/* use results from first call to qh_new_qhull */
620
qh_freeqhull(qh_ALL); /* frees all memory used by first call */
621
qh_restore_qhull(&oldqhB);
622
/* use results from second call to qh_new_qhull */
623
qh_freeqhull(!qh_ALL); /* frees long memory used by second call */
624
qh_memfreeshort(&curlong, &totlong); /* frees short memory and memory allocator */
627
/*-<a href="qh-user.htm#TOC"
628
>--------------------------------</a><a name="QUICKhelp">-</a>
631
=1 to use abbreviated help messages, e.g., for degenerate inputs
633
#define qh_QUICKhelp 0
635
/*============================================================*/
636
/*============= -merge constants- ============================*/
637
/*============================================================*/
639
These constants effect facet merging. You probably will not need
640
to modify them. They effect the performance of facet merging.
643
/*-<a href="qh-user.htm#TOC"
644
>--------------------------------</a><a name="DIMmergeVertex">-</a>
647
max dimension for vertex merging (it is not effective in high-d)
649
#define qh_DIMmergeVertex 6
651
/*-<a href="qh-user.htm#TOC"
652
>--------------------------------</a><a name="DIMreduceBuild">-</a>
655
max dimension for vertex reduction during build (slow in high-d)
657
#define qh_DIMreduceBuild 5
659
/*-<a href="qh-user.htm#TOC"
660
>--------------------------------</a><a name="BESTcentrum">-</a>
663
if > 2*dim+n vertices, qh_findbestneighbor() tests centrums (faster)
664
else, qh_findbestneighbor() tests all vertices (much better merges)
667
if qh_BESTcentrum2 * DIM3 + BESTcentrum < #vertices tests centrums
669
#define qh_BESTcentrum 20
670
#define qh_BESTcentrum2 2
672
/*-<a href="qh-user.htm#TOC"
673
>--------------------------------</a><a name="BESTnonconvex">-</a>
676
if > dim+n neighbors, qh_findbestneighbor() tests nonconvex ridges.
679
It is needed because qh_findbestneighbor is slow for large facets
681
#define qh_BESTnonconvex 15
683
/*-<a href="qh-user.htm#TOC"
684
>--------------------------------</a><a name="MAXnewmerges">-</a>
687
if >n newmerges, qh_merge_nonconvex() calls qh_reducevertices_centrums.
690
It is needed because postmerge can merge many facets at once
692
#define qh_MAXnewmerges 2
694
/*-<a href="qh-user.htm#TOC"
695
>--------------------------------</a><a name="MAXnewcentrum">-</a>
698
if <= dim+n vertices (n approximates the number of merges),
699
reset the centrum in qh_updatetested() and qh_mergecycle_facets()
702
needed to reduce cost and because centrums may move too much if
703
many vertices in high-d
705
#define qh_MAXnewcentrum 5
707
/*-<a href="qh-user.htm#TOC"
708
>--------------------------------</a><a name="COPLANARratio">-</a>
711
for 3-d+ merging, qh.MINvisible is n*premerge_centrum
714
for non-merging, it's DISTround
716
#define qh_COPLANARratio 3
718
/*-<a href="qh-user.htm#TOC"
719
>--------------------------------</a><a name="DISToutside">-</a>
722
When is a point clearly outside of a facet?
723
Stops search in qh_findbestnew or qh_partitionall
724
qh_findbest uses qh.MINoutside since since it is only called if no merges.
727
'Qf' always searches for best facet
728
if !qh.MERGING, same as qh.MINoutside.
729
if qh_USEfindbestnew, increase value since neighboring facets may be ill-behaved
730
[Note: Zdelvertextot occurs normally with interior points]
731
RBOX 1000 s Z1 G1e-13 t1001188774 | QHULL Tv
732
When there is a sharp edge, need to move points to a
733
clearly good facet; otherwise may be lost in another partitioning.
734
if too big then O(n^2) behavior for partitioning in cone
735
if very small then important points not processed
736
Needed in qh_partitionall for
737
RBOX 1000 s Z1 G1e-13 t1001032651 | QHULL Tv
738
Needed in qh_findbestnew for many instances of
739
RBOX 1000 s Z1 G1e-13 t | QHULL Tv
742
qh_DISToutside -- when is a point clearly outside of a facet
743
qh_SEARCHdist -- when is facet coplanar with the best facet?
744
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
746
#define qh_DISToutside ((qh_USEfindbestnew ? 2 : 1) * \
747
fmax_((qh MERGING ? 2 : 1)*qh MINoutside, qh max_outside))
749
/*-<a href="qh-user.htm#TOC"
750
>--------------------------------</a><a name="RATIOnearinside">-</a>
753
ratio of qh.NEARinside to qh.ONEmerge for retaining inside points for
757
This is overkill since do not know the correct value.
758
It effects whether 'Qc' reports all coplanar points
759
Not used for 'd' since non-extreme points are coplanar
761
#define qh_RATIOnearinside 5
763
/*-<a href="qh-user.htm#TOC"
764
>--------------------------------</a><a name="SEARCHdist">-</a>
767
When is a facet coplanar with the best facet?
768
qh_findbesthorizon: all coplanar facets of the best facet need to be searched.
771
qh_DISToutside -- when is a point clearly outside of a facet
772
qh_SEARCHdist -- when is facet coplanar with the best facet?
773
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
775
#define qh_SEARCHdist ((qh_USEfindbestnew ? 2 : 1) * \
776
(qh max_outside + 2 * qh DISTround + fmax_( qh MINvisible, qh MAXcoplanar)));
778
/*-<a href="qh-user.htm#TOC"
779
>--------------------------------</a><a name="USEfindbestnew">-</a>
782
Always use qh_findbestnew for qh_partitionpoint, otherwise use
783
qh_findbestnew if merged new facet or sharpnewfacets.
786
qh_DISToutside -- when is a point clearly outside of a facet
787
qh_SEARCHdist -- when is facet coplanar with the best facet?
788
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
790
#define qh_USEfindbestnew (zzval_(Ztotmerge) > 50)
792
/*-<a href="qh-user.htm#TOC"
793
>--------------------------------</a><a name="WIDEcoplanar">-</a>
796
n*MAXcoplanar or n*MINvisible for a WIDEfacet
798
if vertex is further than qh.WIDEfacet from the hyperplane
799
then its ridges are not counted in computing the area, and
800
the facet's centrum is frozen.
803
qh.WIDEfacet= max(qh.MAXoutside,qh_WIDEcoplanar*qh.MAXcoplanar,
804
qh_WIDEcoplanar * qh.MINvisible);
806
#define qh_WIDEcoplanar 6
808
/*-<a href="qh-user.htm#TOC"
809
>--------------------------------</a><a name="MAXnarrow">-</a>
812
max. cosine in initial hull that sets qh.NARROWhull
815
If qh.NARROWhull, the initial partition does not make
816
coplanar points. If narrow, a coplanar point can be
817
coplanar to two facets of opposite orientations and
818
distant from the exact convex hull.
820
Conservative estimate. Don't actually see problems until it is -1.0
822
#define qh_MAXnarrow -0.99999999
824
/*-<a href="qh-user.htm#TOC"
825
>--------------------------------</a><a name="WARNnarrow">-</a>
828
max. cosine in initial hull to warn about qh.NARROWhull
831
this is a conservative estimate.
832
Don't actually see problems until it is -1.0. See qh-impre.htm
834
#define qh_WARNnarrow -0.999999999999999
836
/*-<a href="qh-user.htm#TOC"
837
>--------------------------------</a><a name="ZEROdelaunay">-</a>
840
a zero Delaunay facet occurs for input sites coplanar with their convex hull
841
the last normal coefficient of a zero Delaunay facet is within
842
qh_ZEROdelaunay * qh.ANGLEround of 0
845
qh_ZEROdelaunay does not allow for joggled input ('QJ').
847
You can avoid zero Delaunay facets by surrounding the input with a box.
849
Use option 'PDk:-n' to explicitly define zero Delaunay facets
850
k= dimension of input sites (e.g., 3 for 3-d Delaunay triangulation)
851
n= the cutoff for zero Delaunay facets (e.g., 'PD3:-1e-12')
853
#define qh_ZEROdelaunay 2
855
#endif /* qh_DEFuser */