rbox_r.c
Go to the documentation of this file.
1 
2 /*<html><pre> -<a href="../libqhull/index.htm#TOC"
3  >-------------------------------</a><a name="TOP">-</a>
4 
5  rbox.c
6  rbox program for generating input points for qhull.
7 
8  notes:
9  50 points generated for 'rbox D4'
10 
11 */
12 
13 #include "libqhull_r/libqhull_r.h"
14 #include "libqhull/random_r.h"
15 
16 #include <stdarg.h>
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20 
21 #ifdef _MSC_VER /* Microsoft Visual C++ -- warning level 4 */
22 #pragma warning( disable : 4706) /* assignment within conditional function */
23 #endif
24 
25 char prompt[]= "\n\
26 -rbox- generate various point distributions. Default is random in cube.\n\
27 \n\
28 args (any order, space separated): Version: 2016/01/18 r\n\
29  3000 number of random points in cube, lens, spiral, sphere or grid\n\
30  D3 dimension 3-d\n\
31  c add a unit cube to the output ('c G2.0' sets size)\n\
32  d add a unit diamond to the output ('d G2.0' sets size)\n\
33  l generate a regular 3-d spiral\n\
34  r generate a regular polygon, ('r s Z1 G0.1' makes a cone)\n\
35  s generate cospherical points\n\
36  x generate random points in simplex, may use 'r' or 'Wn'\n\
37  y same as 'x', plus simplex\n\
38  Cn,r,m add n nearly coincident points within radius r of m points\n\
39  Pn,m,r add point [n,m,r] first, pads with 0, maybe repeated\n\
40 \n\
41  Ln lens distribution of radius n. Also 's', 'r', 'G', 'W'.\n\
42  Mn,m,r lattice(Mesh) rotated by [n,-m,0], [m,n,0], [0,0,r], ...\n\
43  '27 M1,0,1' is {0,1,2} x {0,1,2} x {0,1,2}. Try 'M3,4 z'.\n\
44  W0.1 random distribution within 0.1 of the cube's or sphere's surface\n\
45  Z0.5 s random points in a 0.5 disk projected to a sphere\n\
46  Z0.5 s G0.6 same as Z0.5 within a 0.6 gap\n\
47 \n\
48  Bn bounding box coordinates, default %2.2g\n\
49  h output as homogeneous coordinates for cdd\n\
50  n remove command line from the first line of output\n\
51  On offset coordinates by n\n\
52  t use time as the random number seed(default is command line)\n\
53  tn use n as the random number seed\n\
54  z print integer coordinates, default 'Bn' is %2.2g\n\
55 ";
56 
57 /*--------------------------------------------
58 -rbox- main procedure of rbox application
59 */
60 int main(int argc, char **argv) {
61  int return_status;
62  qhT qh_qh;
63  qhT *qh= &qh_qh;
64 
66 
67  if (argc == 1) {
69  return 1;
70  }
71  if (argc == 2 && strcmp(argv[1], "D4")==0)
72  qh_fprintf_stderr(0, "\nStarting the rbox smoketest for qhull. An immediate failure indicates\nthat reentrant rbox was linked to non-reentrant routines. An immediate\nfailure of qhull may indicate that qhull was linked to the wrong\nqhull library. Also try 'rbox D4 | qhull T1'\n");
73 
74  qh_init_A(qh, stdin, stdout, stderr, argc, argv); /*no qh_errexit, sets qh->qhull_command */
75  return_status= qh_rboxpoints(qh, qh->qhull_command); /* Traps its own errors, qh_errexit_rbox() */
76  return return_status;
77 }/*main*/
78 
qh_DEFAULTbox
#define qh_DEFAULTbox
Definition: user.h:486
qh_fprintf_stderr
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
Definition: usermem.c:57
qhT
Definition: libqhull.h:465
qh_rboxpoints
int qh_rboxpoints(FILE *fout, FILE *ferr, char *rbox_command)
Definition: rboxlib.c:90
prompt
char prompt[]
Definition: rbox_r.c:25
qh_qh
qhT qh_qh
Definition: global.c:26
qh_DEFAULTzbox
#define qh_DEFAULTzbox
Definition: user.h:487
qh_init_A
void qh_init_A(FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[])
Definition: global.c:487
libqhull_r.h
qh
#define qh
Definition: libqhull.h:457
QHULL_LIB_CHECK_RBOX
#define QHULL_LIB_CHECK_RBOX
Definition: libqhull.h:463
main
int main(int argc, char **argv)
Definition: rbox_r.c:60


hpp-fcl
Author(s):
autogenerated on Fri Jan 26 2024 03:46:15