67 printf(
"\n%d vertices and %d facets with normals:\n",
68 qh->num_vertices,
qh->num_facets);
70 for (k=0; k <
qh->hull_dim; k++)
71 printf(
"%6.2g ", facet->
normal[k]);
84 for (j=0; j<numpoints; j++) {
85 point= points + j*
dim;
105 printf(
"seed: %d\n",
seed);
107 for (j=0; j<numpoints; j++) {
108 point= points + j*
dim;
109 for (k= 0; k <
dim; k++) {
133 for (k= 0; k <
dim; k++)
138 fprintf(stderr,
"findDelaunay: not implemented for triangulated, non-simplicial Delaunay regions (tricoplanar facet, f%d).\n",
143 for (k=0; k <
dim; k++)
144 printf(
"%5.2f ", vertex->
point[k]);
159 for (j=0; j<numpoints; j++) {
160 point= points + j*(
dim+1);
172 #define SIZEcube (1<<DIM)
173 #define SIZEdiamond (2*DIM)
174 #define TOTpoints (SIZEcube + SIZEdiamond)
185 int main(
int argc,
char *argv[]) {
192 FILE *outfile= stdout;
194 FILE *errfile= stderr;
197 int curlong, totlong;
207 printf(
"This is the output from user_eg_r.c\n\n\
208 It shows how qhull() may be called from an application using the qhull\n\
209 reentrant library. user_eg is not part of qhull itself. If it appears\n\
210 accidently, please remove user_eg_r.c from your project. If it fails\n\
211 immediately, user_eg_r.c was incorrectly linked to the non-reentrant library.\n\
212 Also try 'user_eg T1 2>&1'\n\n");
217 printf(
"\ncompute convex hull of cube after rotating input\n");
218 sprintf(flags,
"qhull s Tcv %s", argc >= 2 ? argv[1] :
"");
221 for (i=numpoints; i--; )
225 flags, outfile, errfile);
235 if (curlong || totlong)
236 fprintf(errfile,
"qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
242 printf(
"\ncompute %d-d Delaunay triangulation\n",
dim);
243 sprintf(flags,
"qhull s d Tcv %s", argc >= 3 ? argv[2] :
"");
246 for (i=numpoints; i--; )
250 flags, outfile, errfile);
259 printf(
"\nfind %d-d Delaunay triangle closest to [0.5, 0.5, ...]\n",
dim);
260 exitcode= setjmp(
qh->errexit);
276 printf(
"\nCompute a new triangulation as a separate instance of Qhull\n");
277 sprintf(flags,
"qhull s d Tcv %s", argc >= 3 ? argv[2] :
"");
280 for (i=numpoints; i--; )
284 flags, outfile, errfile);
287 printf(
"\nFree memory allocated by the new instance of Qhull, and redisplay the old results.\n");
290 if (curlong || totlong)
291 fprintf(errfile,
"qhull internal warning (user_eg, #4): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
299 if (curlong || totlong)
300 fprintf(errfile,
"qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
305 printf(
"\ncompute halfspace intersection about the origin for a diamond\n");
306 sprintf(flags,
"qhull H0 s Tcv %s", argc >= 4 ? argv[3] :
"Fp");
309 for (i=numpoints; i--; )
316 flags, outfile, errfile);
321 if (curlong || totlong)
322 fprintf(stderr,
"qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n",