gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
tetgenBR.h
Go to the documentation of this file.
1 // This file is part of Tetgen/BR, the Boundary Recovery code of TetGen
2 //
3 // Copyright 2015-2016 Weierstrass Institute for Applied Analysis and
4 // Stochastics
5 //
6 // This file is relicensed under the terms of LICENSE.txt for use in Gmsh thanks
7 // to a Software License Agreement between Weierstrass Institute for Applied
8 // Analysis and Stochastics and GMESH SPRL.
9 
11 // //
12 // TetGen //
13 // //
14 // A Quality Tetrahedral Mesh Generator and A 3D Delaunay Triangulator //
15 // //
16 // Version 1.5 //
17 // May 31, 2014 //
18 // //
19 // Copyright (C) 2002--2016 //
20 // //
21 // TetGen is freely available through the website: http://www.tetgen.org. //
22 // It may be copied, modified, and redistributed for non-commercial use. //
23 // Please consult the file LICENSE for the detailed copyright notices. //
24 // //
26 
27 // The following code of this file was automatically generated. Do not edit!
28 // TetGenBR -- The Boundary Recovery code of TetGen.
29 
30 #ifndef tetgenBRH
31 #define tetgenBRH
32 
34 // //
35 // tetgenbehavior //
36 // //
37 // A structure for maintaining the switches and parameters used by TetGen's //
38 // mesh data structure and algorithms. //
39 // //
40 // All switches and parameters are initialized with default values. They can //
41 // be set by the command line arguments (a list of strings) of TetGen. //
42 // //
43 // NOTE: Some of the switches are incompatible. While some may depend on //
44 // other switches. The routine parse_commandline() sets the switches from //
45 // the command line (a list of strings) and checks the consistency of the //
46 // applied switches. //
47 // //
49 
51 public:
52  // Switches of TetGen.
53  int plc; // '-p', 0.
54  int psc; // '-s', 0.
55  int refine; // '-r', 0.
56  int quality; // '-q', 0.
57  int nobisect; // '-Y', 0.
58  int coarsen; // '-R', 0.
59  int weighted; // '-w', 0.
60  int brio_hilbert; // '-b', 1.
61  int incrflip; // '-l', 0.
62  int flipinsert; // '-L', 0.
63  int metric; // '-m', 0.
64  int varvolume; // '-a', 0.
65  int fixedvolume; // '-a', 0.
66  int regionattrib; // '-A', 0.
67  int cdtrefine; // '-D', 0.
68  int insertaddpoints; // '-i', 0.
69  int diagnose; // '-d', 0.
70  int convex; // '-c', 0.
71  int nomergefacet; // '-M', 0.
72  int nomergevertex; // '-M', 0.
73  int noexact; // '-X', 0.
74  int nostaticfilter; // '-X', 0.
75  int zeroindex; // '-z', 0.
76  int facesout; // '-f', 0.
77  int edgesout; // '-e', 0.
78  int neighout; // '-n', 0.
79  int voroout; // '-v', 0.
80  int meditview; // '-g', 0.
81  int vtkview; // '-k', 0.
82  int nobound; // '-B', 0.
83  int nonodewritten; // '-N', 0.
84  int noelewritten; // '-E', 0.
85  int nofacewritten; // '-F', 0.
86  int noiterationnum; // '-I', 0.
87  int nojettison; // '-J', 0.
88  int docheck; // '-C', 0.
89  int quiet; // '-Q', 0.
90  int verbose; // '-V', 0.
91 
92  // Parameters of TetGen.
93  int vertexperblock; // '-x', 4092.
94  int tetrahedraperblock; // '-x', 8188.
95  int shellfaceperblock; // '-x', 2044.
96  int nobisect_nomerge; // '-Y', 1.
97  int supsteiner_level; // '-Y/', 2.
98  int addsteiner_algo; // '-Y//', 1.
99  int coarsen_param; // '-R', 0.
100  int weighted_param; // '-w', 0.
101  int fliplinklevel; // -1.
102  int flipstarsize; // -1.
103  int fliplinklevelinc; // 1.
104  int reflevel; // '-D', 3.
105  int optlevel; // '-O', 2.
106  int optscheme; // '-O', 7.
107  int delmaxfliplevel; // 1.
108  int order; // '-o', 1.
109  int reversetetori; // '-o/', 0.
110  int steinerleft; // '-S', 0.
111  int no_sort; // 0.
112  int hilbert_order; // '-b///', 52.
113  int hilbert_limit; // '-b//' 8.
114  int brio_threshold; // '-b' 64.
115  REAL brio_ratio; // '-b/' 0.125.
116  REAL facet_separate_ang_tol; // '-p', 179.9.
117  REAL facet_overlap_ang_tol; // '-p/', 0.1.
118  REAL facet_small_ang_tol; // '-p//', 15.0.
119  REAL maxvolume; // '-a', -1.0.
120  REAL minratio; // '-q', 0.0.
121  REAL mindihedral; // '-q', 5.0.
122  REAL optmaxdihedral; // 165.0.
123  REAL optminsmtdihed; // 179.0.
124  REAL optminslidihed; // 179.0.
125  REAL epsilon; // '-T', 1.0e-8.
126  REAL coarsen_percent; // -R1/#, 1.0.
127 
128  // Strings of command line arguments and input/output file names.
129  char commandline[1024];
130  char infilename[1024];
131  char outfilename[1024];
132  char addinfilename[1024];
133  char bgmeshfilename[1024];
134 
135  // The input object of TetGen. They are recognized by either the input
136  // file extensions or by the specified options.
137  // Currently the following objects are supported:
138  // - NODES, a list of nodes (.node);
139  // - POLY, a piecewise linear complex (.poly or .smesh);
140  // - OFF, a polyhedron (.off, Geomview's file format);
141  // - PLY, a polyhedron (.ply, file format from gatech, only ASCII);
142  // - STL, a surface mesh (.stl, stereolithography format);
143  // - MEDIT, a surface mesh (.mesh, Medit's file format);
144  // - MESH, a tetrahedral mesh (.ele).
145  // If no extension is available, the imposed command line switch
146  // (-p or -r) implies the object.
148 
149  void syntax();
150  void usage();
151 
152  // Command line parse routine.
153  bool parse_commandline(int argc, char **argv);
154  bool parse_commandline(char *switches)
155  {
156  return parse_commandline(0, &switches);
157  }
158 
159  // Initialize all variables.
161  {
162  plc = 0;
163  psc = 0;
164  refine = 0;
165  quality = 0;
166  nobisect = 0;
167  coarsen = 0;
168  metric = 0;
169  weighted = 0;
170  brio_hilbert = 1;
171  incrflip = 0;
172  flipinsert = 0;
173  varvolume = 0;
174  fixedvolume = 0;
175  noexact = 0;
176  nostaticfilter = 0;
177  insertaddpoints = 0;
178  regionattrib = 0;
179  cdtrefine = 0;
180  diagnose = 0;
181  convex = 0;
182  zeroindex = 0;
183  facesout = 0;
184  edgesout = 0;
185  neighout = 0;
186  voroout = 0;
187  meditview = 0;
188  vtkview = 0;
189  nobound = 0;
190  nonodewritten = 0;
191  noelewritten = 0;
192  nofacewritten = 0;
193  noiterationnum = 0;
194  nomergefacet = 0;
195  nomergevertex = 0;
196  nojettison = 0;
197  docheck = 0;
198  quiet = 0;
199  verbose = 0;
200 
201  vertexperblock = 4092;
202  tetrahedraperblock = 8188;
203  shellfaceperblock = 4092;
204  nobisect_nomerge = 1;
205  supsteiner_level = 2;
206  addsteiner_algo = 1;
207  coarsen_param = 0;
208  weighted_param = 0;
209  fliplinklevel = -1;
210  flipstarsize = -1;
211  fliplinklevelinc = 1;
212  reflevel = 3;
213  optscheme = 7;
214  optlevel = 2;
215  delmaxfliplevel = 1;
216  order = 1;
217  reversetetori = 0;
218  steinerleft = -1;
219  no_sort = 0;
220  hilbert_order = 52; //-1;
221  hilbert_limit = 8;
222  brio_threshold = 64;
223  brio_ratio = 0.125;
224  facet_separate_ang_tol = 179.9;
225  facet_overlap_ang_tol = 0.1;
226  facet_small_ang_tol = 15.0;
227  maxvolume = -1.0;
228  minratio = 2.0;
229  mindihedral = 0.0;
230  optmaxdihedral = 165.00;
231  optminsmtdihed = 179.00;
232  optminslidihed = 179.00;
233  epsilon = 1.0e-8;
234  coarsen_percent = 1.0;
235  object = NODES;
236 
237  commandline[0] = '\0';
238  infilename[0] = '\0';
239  outfilename[0] = '\0';
240  addinfilename[0] = '\0';
241  bgmeshfilename[0] = '\0';
242  }
243 
244 }; // class tetgenbehavior
245 
247 // //
248 // tetgenmesh //
249 // //
250 // A structure for creating and updating tetrahedral meshes. //
251 // //
253 
254 class tetgenmesh {
255 public:
257  // //
258  // Mesh data structure //
259  // //
260  // A tetrahedral mesh T of a 3D piecewise linear complex (PLC) X is a 3D //
261  // simplicial complex whose underlying space is equal to the space of X. T //
262  // contains a 2D subcomplex S which is a triangular mesh of the boundary of //
263  // X. S contains a 1D subcomplex L which is a linear mesh of the boundary of
264  // // S. Faces and edges in S and L are respectively called subfaces and
265  // segme- // nts to distinguish them from others in T.
266  // //
267  // //
268  // TetGen stores the tetrahedra and vertices of T. The basic structure of a //
269  // tetrahedron contains pointers to its vertices and adjacent tetrahedra. A //
270  // vertex stores its x-, y-, and z-coordinates, and a pointer to a tetrahed-
271  // // ron containing it. Both tetrahedra and vertices may contain user data.
272  // //
273  // //
274  // Each face of T belongs to either two tetrahedra or one tetrahedron. In //
275  // the latter case, the face is an exterior boundary face of T. TetGen adds
276  // // fictitious tetrahedra (one-to-one) at such faces, and connects them to
277  // an // "infinite vertex" (which has no geometric coordinates). One can
278  // imagine // such a vertex lies in 4D space and is visible by all exterior
279  // boundary // faces. The extended set of tetrahedra (including the
280  // infinite vertex) is // a tetrahedralization of a 3-pseudomanifold without
281  // boundary. It has the // property that every face is shared by exactly two
282  // tetrahedra. //
283  // //
284  // The current version of TetGen stores explicitly the subfaces and segments
285  // // (which are in surface mesh S and the linear mesh L), respectively.
286  // Extra // pointers are allocated in tetrahedra and subfaces to point each
287  // others. //
288  // //
290 
291  // The tetrahedron data structure. It includes the following fields:
292  // - a list of four adjoining tetrahedra;
293  // - a list of four vertices;
294  // - a pointer to a list of four subfaces (optional, for -p switch);
295  // - a pointer to a list of six segments (optional, for -p switch);
296  // - a list of user-defined floating-point attributes (optional);
297  // - a volume constraint (optional, for -a switch);
298  // - an integer of element marker (and flags);
299  // The structure of a tetrahedron is an array of pointers. Its actual size
300  // (the length of the array) is determined at runtime.
301 
302  typedef REAL **tetrahedron;
303 
304  // The subface data structure. It includes the following fields:
305  // - a list of three adjoining subfaces;
306  // - a list of three vertices;
307  // - a list of three adjoining segments;
308  // - two adjoining tetrahedra;
309  // - an area constraint (optional, for -q switch);
310  // - an integer for boundary marker;
311  // - an integer for type, flags, etc.
312 
313  typedef REAL **shellface;
314 
315  // The point data structure. It includes the following fields:
316  // - x, y and z coordinates;
317  // - a list of user-defined point attributes (optional);
318  // - u, v coordinates (optional, for -s switch);
319  // - a metric tensor (optional, for -q or -m switch);
320  // - a pointer to an adjacent tetrahedron;
321  // - a pointer to a parent (or a duplicate) point;
322  // - a pointer to an adjacent subface or segment (optional, -p switch);
323  // - a pointer to a tet in background mesh (optional, for -m switch);
324  // - an integer for boundary marker (point index);
325  // - an integer for point type (and flags).
326  // - an integer for geometry tag (optional, for -s switch).
327  // The structure of a point is an array of REALs. Its acutal size is
328  // determined at the runtime.
329 
330  typedef REAL *point;
331 
333  // //
334  // Handles //
335  // //
336  // Navigation and manipulation in a tetrahedralization are accomplished by //
337  // operating on structures referred as ``handles". A handle is a pair (t,v),
338  // // where t is a pointer to a tetrahedron, and v is a 4-bit integer, in the
339  // // range from 0 to 11. v is called the ``version'' of a tetrahedron, it
340  // rep- // resents a directed edge of a specific face of the tetrahedron.
341  // //
342  // //
343  // There are 12 even permutations of the four vertices, each of them corres-
344  // // ponds to a directed edge (a version) of the tetrahedron. The 12
345  // versions // can be grouped into 4 distinct ``edge rings'' in 4 ``oriented
346  // faces'' of // this tetrahedron. One can encode each version (a directed
347  // edge) into a // 4-bit integer such that the two upper bits encode the
348  // index (from 0 to 2) // of this edge in the edge ring, and the two lower
349  // bits encode the index ( // from 0 to 3) of the oriented face which
350  // contains this edge. //
351  // //
352  // The four vertices of a tetrahedron are indexed from 0 to 3 (according to //
353  // their storage in the data structure). Give each face the same index as //
354  // the node opposite it in the tetrahedron. Denote the edge connecting face
355  // // i to face j as i/j. We number the twelve versions as follows:
356  // //
357  // //
358  // | edge 0 edge 1 edge 2 //
359  // --------|-------------------------------- //
360  // face 0 | 0 (0/1) 4 (0/3) 8 (0/2) // face 1 | 1 (1/2) 5
361  // (1/3) 9 (1/0) // face 2 | 2 (2/3)
362  // 6 (2/1) 10 (2/0) // face 3 | 3 (3/0)
363  // 7 (3/1) 11 (3/2) //
364  // //
365  // Similarly, navigation and manipulation in a (boundary) triangulation are //
366  // done by using handles of triangles. Each handle is a pair (s, v), where s
367  // // is a pointer to a triangle, and v is a version in the range from 0 to 5.
368  // // Each version corresponds to a directed edge of this triangle.
369  // //
370  // //
371  // Number the three vertices of a triangle from 0 to 2 (according to their //
372  // storage in the data structure). Give each edge the same index as the node
373  // // opposite it in the triangle. The six versions of a triangle are:
374  // //
375  // //
376  // | edge 0 edge 1 edge 2 //
377  // ---------------|-------------------------- //
378  // ccw orieation | 0 2 4 //
379  // cw orieation | 1 3 5 //
380  // //
381  // In the following, a 'triface' is a handle of tetrahedron, and a 'face' is
382  // // a handle of a triangle.
383  // //
384  // //
386 
387  class triface {
388  public:
390  int ver; // Range from 0 to 11.
391  triface() : tet(0), ver(0) {}
393  {
394  tet = t.tet;
395  ver = t.ver;
396  return *this;
397  }
398  };
399 
400  class face {
401  public:
403  int shver; // Range from 0 to 5.
404  face() : sh(0), shver(0) {}
405  face &operator=(const face &s)
406  {
407  sh = s.sh;
408  shver = s.shver;
409  return *this;
410  }
411  };
412 
414  // //
415  // Arraypool //
416  // //
417  // A dynamic linear array. (It is written by J. Shewchuk) //
418  // //
419  // Each arraypool contains an array of pointers to a number of blocks. Each
420  // // block contains the same fixed number of objects. Each index of the
421  // array // addresses a particular object in the pool. The most significant
422  // bits add- // ress the index of the block containing the object. The less
423  // significant // bits address this object within the block.
424  // //
425  // //
426  // 'objectbytes' is the size of one object in blocks; 'log2objectsperblock' //
427  // is the base-2 logarithm of 'objectsperblock'; 'objects' counts the number
428  // // of allocated objects; 'totalmemory' is the total memory in bytes.
429  // //
430  // //
432 
433  class arraypool {
434  public:
440  char **toparray;
441  long objects;
442  unsigned long totalmemory;
443 
444  void restart();
445  void poolinit(int sizeofobject, int log2objperblk);
446  char *getblock(int objectindex);
447  void *lookup(int objectindex);
448  int newindex(void **newptr);
449 
450  arraypool(int sizeofobject, int log2objperblk);
451  ~arraypool();
452  };
453 
454  // fastlookup() -- A fast, unsafe operation. Return the pointer to the object
455  // with a given index. Note: The object's block must have been allocated,
456  // i.e., by the function newindex().
457 
458 #define fastlookup(pool, index) \
459  (void *)((pool)->toparray[(index) >> (pool)->log2objectsperblock] + \
460  ((index) & (pool)->objectsperblockmark) * (pool)->objectbytes)
461 
463  // //
464  // Memorypool //
465  // //
466  // A structure for memory allocation. (It is written by J. Shewchuk) //
467  // //
468  // firstblock is the first block of items. nowblock is the block from which //
469  // items are currently being allocated. nextitem points to the next slab //
470  // of free memory for an item. deaditemstack is the head of a linked list //
471  // (stack) of deallocated items that can be recycled. unallocateditems is
472  // // the number of items that remain to be allocated from nowblock.
473  // //
474  // //
475  // Traversal is the process of walking through the entire list of items, and
476  // //
477  // is separate from allocation. Note that a traversal will visit items on
478  // // the "deaditemstack" stack as well as live items. pathblock points to
479  // // the block currently being traversed. pathitem points to the next item
480  // // to be traversed. pathitemsleft is the number of items that remain to
481  // // be traversed in pathblock.
482  // //
483  // //
485 
486  class memorypool {
487  public:
488  void **firstblock, **nowblock;
489  void *nextitem;
491  void **pathblock;
492  void *pathitem;
499 
500  memorypool();
501  memorypool(int, int, int, int);
502  ~memorypool();
503 
504  void poolinit(int, int, int, int);
505  void restart();
506  void *alloc();
507  void dealloc(void *);
508  void traversalinit();
509  void *traverse();
510  };
511 
513  // //
514  // badface //
515  // //
516  // Despite of its name, a 'badface' can be used to represent one of the //
517  // following objects: //
518  // - a face of a tetrahedron which is (possibly) non-Delaunay; //
519  // - an encroached subsegment or subface; //
520  // - a bad-quality tetrahedron, i.e, has too large radius-edge ratio; //
521  // - a sliver, i.e., has good radius-edge ratio but nearly zero volume; //
522  // - a recently flipped face (saved for undoing the flip later). //
523  // //
525 
526  class badface {
527  public:
530  REAL key, cent[6]; // circumcenter or cos(dihedral angles) at 6 edges.
534  : key(0), forg(0), fdest(0), fapex(0), foppo(0), noppo(0), nextitem(0)
535  {
536  }
537  };
538 
540  // //
541  // insertvertexflags //
542  // //
543  // A collection of flags that pass to the routine insertvertex(). //
544  // //
546 
548  public:
549  int iloc; // input/output.
555 
556  // Used by Delaunay refinement.
557  int refineflag; // 0, 1, 2, 3
560  int smlenflag; // for useinsertradius.
561  REAL smlen; // for useinsertradius.
563 
565  {
566  iloc = bowywat = lawson = 0;
568  rejflag = chkencflag = cdtflag = 0;
569  assignmeshsize = 0;
570  sloc = sbowywat = 0;
571 
572  refineflag = 0;
573  refinetet.tet = NULL;
574  refinesh.sh = NULL;
575  smlenflag = 0;
576  smlen = 0.0;
577  }
578  };
579 
581  // //
582  // flipconstraints //
583  // //
584  // A structure of a collection of data (options and parameters) which pass //
585  // to the edge flip function flipnm(). //
586  // //
588 
590  public:
591  // Elementary flip flags.
592  int enqflag; // (= flipflag)
594 
595  // Control flags
596  int unflip; // Undo the performed flips.
597  int collectnewtets; // Collect the new tets created by flips.
599 
600  // Optimization flags.
601  int remove_ndelaunay_edge; // Remove a non-Delaunay edge.
602  REAL bak_tetprism_vol; // The value to be minimized.
604  int remove_large_angle; // Remove a large dihedral angle at edge.
605  REAL cosdihed_in; // The input cosine of the dihedral angle (> 0).
606  REAL cosdihed_out; // The improved cosine of the dihedral angle.
607 
608  // Boundary recovery flags.
610  point seg[2]; // A constraining edge to be recovered.
611  point fac[3]; // A constraining face to be recovered.
612  point remvert; // A vertex to be removed.
613 
615  {
616  enqflag = 0;
617  chkencflag = 0;
618 
619  unflip = 0;
620  collectnewtets = 0;
621  collectencsegflag = 0;
622 
624  bak_tetprism_vol = 0.0;
625  tetprism_vol_sum = 0.0;
626  remove_large_angle = 0;
627  cosdihed_in = 0.0;
628  cosdihed_out = 0.0;
629 
631  seg[0] = NULL;
632  fac[0] = NULL;
633  remvert = NULL;
634  }
635  };
636 
638  // //
639  // optparameters //
640  // //
641  // Optimization options and parameters. //
642  // //
644 
646  public:
647  // The one of goals of optimization.
648  int max_min_volume; // Maximize the minimum volume.
649  int min_max_aspectratio; // Minimize the maximum aspect ratio.
650  int min_max_dihedangle; // Minimize the maximum dihedral angle.
651 
652  // The initial and improved value.
654 
657  int maxiter; // Maximum smoothing iterations (disabled by -1).
658  int smthiter; // Performed iterations.
659 
661  {
662  max_min_volume = 0;
664  min_max_dihedangle = 0;
665 
666  initval = imprval = 0.0;
667 
668  numofsearchdirs = 10;
669  searchstep = 0.01;
670  maxiter = -1; // Unlimited smoothing iterations.
671  smthiter = 0;
672  }
673  };
674 
676  // //
677  // Labels (enumeration declarations) used by TetGen. //
678  // //
680 
681  // Labels that signify the type of a vertex.
682  enum verttype {
693  DEADVERTEX
694  };
695 
696  // Labels that signify the result of triangle-triangle intersection test.
697  enum interresult {
707  ACROSSFACE
708  };
709 
710  // Labels that signify the result of point location.
724  BADELEMENT
725  };
726 
728  // //
729  // Variables of TetGen //
730  // //
732 
733  // Pointer to the input data (a set of nodes, a PLC, or a mesh).
734  tetgenio *in, *addin;
735 
736  // Pointer to the switches and parameters.
738 
739  // Pointer to a background mesh (contains size specification map).
741 
742  // Memorypools to store mesh elements (points, tetrahedra, subfaces, and
743  // segments) and extra pointers between tetrahedra, subfaces, and segments.
746 
747  // Memorypools to store bad-quality (or encroached) elements.
749 
750  // A memorypool to store faces to be flipped.
754 
755  // Arrays used for point insertion (the Bowyer-Watson algorithm).
760 
761  // Stacks used for CDT construction and boundary recovery.
763 
764  // Arrays of encroached segments and subfaces (for mesh refinement).
766 
767  // The map between facets to their vertices (for mesh refinement).
770 
771  // The map between segments to their endpoints (for mesh refinement).
773 
774  // The infinite vertex.
776  // The recently visited tetrahedron, subface.
779 
780  // PI is the ratio of a circle's circumference to its diameter.
781  static REAL PI;
782 
783  // Array (size = numberoftetrahedra * 6) for storing high-order nodes of
784  // tetrahedra (only used when -o2 switch is selected).
786 
787  // Various variables.
788  int numpointattrib; // Number of point attributes.
789  int numelemattrib; // Number of tetrahedron attributes.
790  int sizeoftensor; // Number of REALs per metric tensor.
791  int pointmtrindex; // Index to find the metric tensor of a point.
792  int pointparamindex; // Index to find the u,v coordinates of a point.
793  int point2simindex; // Index to find a simplex adjacent to a point.
794  int pointmarkindex; // Index to find boundary marker of a point.
795  int pointinsradiusindex; // Index to find the insertion radius of a point.
796  int elemattribindex; // Index to find attributes of a tetrahedron.
797  int volumeboundindex; // Index to find volume bound of a tetrahedron.
798  int elemmarkerindex; // Index to find marker of a tetrahedron.
799  int shmarkindex; // Index to find boundary marker of a subface.
800  int areaboundindex; // Index to find area bound of a subface.
801  int checksubsegflag; // Are there segments in the tetrahedralization yet?
802  int checksubfaceflag; // Are there subfaces in the tetrahedralization yet?
803  int checkconstraints; // Are there variant (node, seg, facet) constraints?
804  int nonconvex; // Is current mesh non-convex?
805  int autofliplinklevel; // The increase of link levels, default is 1.
806  int useinsertradius; // Save the insertion radius for Steiner points.
807  long samples; // Number of random samples for point location.
808  unsigned long randomseed; // Current random number seed.
809  REAL cosmaxdihed, cosmindihed; // The cosine values of max/min dihedral.
810  REAL cossmtdihed; // The cosine value of a bad dihedral to be smoothed.
811  REAL cosslidihed; // The cosine value of the max dihedral of a sliver.
812  REAL minfaceang, minfacetdihed; // The minimum input (dihedral) angles.
813  REAL tetprism_vol_sum; // The total volume of tetrahedral-prisms (in 4D).
814  REAL longest; // The longest possible edge length.
815  REAL minedgelength; // = longest * b->epsion.
816  REAL xmax, xmin, ymax, ymin, zmax, zmin; // Bounding box of points.
817 
818  // Counters.
819  long insegments; // Number of input segments.
820  long hullsize; // Number of exterior boundary faces.
821  long meshedges; // Number of mesh edges.
822  long meshhulledges; // Number of boundary mesh edges.
823  long steinerleft; // Number of Steiner points not yet used.
824  long dupverts; // Are there duplicated vertices?
825  long unuverts; // Are there unused vertices?
826  long nonregularcount; // Are there non-regular vertices?
832  unsigned long totalworkmemory; // Total memory used by working arrays.
833 
835  // //
836  // Mesh manipulation primitives //
837  // //
839 
840  // Fast lookup tables for mesh manipulation primitives.
841  static int bondtbl[12][12], fsymtbl[12][12];
842  static int esymtbl[12], enexttbl[12], eprevtbl[12];
843  static int enextesymtbl[12], eprevesymtbl[12];
844  static int eorgoppotbl[12], edestoppotbl[12];
845  static int facepivot1[12], facepivot2[12][12];
846  static int orgpivot[12], destpivot[12], apexpivot[12], oppopivot[12];
847  static int tsbondtbl[12][6], stbondtbl[12][6];
848  static int tspivottbl[12][6], stpivottbl[12][6];
849  static int ver2edge[12], edge2ver[6], epivot[12];
850  static int sorgpivot[6], sdestpivot[6], sapexpivot[6];
851  static int snextpivot[6];
852 
853  void inittables();
854 
855  // Primitives for tetrahedra.
856  inline tetrahedron encode(triface &t);
857  inline tetrahedron encode2(tetrahedron *ptr, int ver);
858  inline void decode(tetrahedron ptr, triface &t);
859  inline void bond(triface &t1, triface &t2);
860  inline void dissolve(triface &t);
861  inline void esym(triface &t1, triface &t2);
862  inline void esymself(triface &t);
863  inline void enext(triface &t1, triface &t2);
864  inline void enextself(triface &t);
865  inline void eprev(triface &t1, triface &t2);
866  inline void eprevself(triface &t);
867  inline void enextesym(triface &t1, triface &t2);
868  inline void enextesymself(triface &t);
869  inline void eprevesym(triface &t1, triface &t2);
870  inline void eprevesymself(triface &t);
871  inline void eorgoppo(triface &t1, triface &t2);
872  inline void eorgoppoself(triface &t);
873  inline void edestoppo(triface &t1, triface &t2);
874  inline void edestoppoself(triface &t);
875  inline void fsym(triface &t1, triface &t2);
876  inline void fsymself(triface &t);
877  inline void fnext(triface &t1, triface &t2);
878  inline void fnextself(triface &t);
879  inline point org(triface &t);
880  inline point dest(triface &t);
881  inline point apex(triface &t);
882  inline point oppo(triface &t);
883  inline void setorg(triface &t, point p);
884  inline void setdest(triface &t, point p);
885  inline void setapex(triface &t, point p);
886  inline void setoppo(triface &t, point p);
887  inline REAL elemattribute(tetrahedron *ptr, int attnum);
888  inline void setelemattribute(tetrahedron *ptr, int attnum, REAL value);
889  inline REAL volumebound(tetrahedron *ptr);
890  inline void setvolumebound(tetrahedron *ptr, REAL value);
891  inline int elemindex(tetrahedron *ptr);
892  inline void setelemindex(tetrahedron *ptr, int value);
893  inline int elemmarker(tetrahedron *ptr);
894  inline void setelemmarker(tetrahedron *ptr, int value);
895  inline void infect(triface &t);
896  inline void uninfect(triface &t);
897  inline bool infected(triface &t);
898  inline void marktest(triface &t);
899  inline void unmarktest(triface &t);
900  inline bool marktested(triface &t);
901  inline void markface(triface &t);
902  inline void unmarkface(triface &t);
903  inline bool facemarked(triface &t);
904  inline void markedge(triface &t);
905  inline void unmarkedge(triface &t);
906  inline bool edgemarked(triface &t);
907  inline void marktest2(triface &t);
908  inline void unmarktest2(triface &t);
909  inline bool marktest2ed(triface &t);
910  inline int elemcounter(triface &t);
911  inline void setelemcounter(triface &t, int value);
912  inline void increaseelemcounter(triface &t);
913  inline void decreaseelemcounter(triface &t);
914  inline bool ishulltet(triface &t);
915  inline bool isdeadtet(triface &t);
916 
917  // Primitives for subfaces and subsegments.
918  inline void sdecode(shellface sptr, face &s);
919  inline shellface sencode(face &s);
920  inline shellface sencode2(shellface *sh, int shver);
921  inline void spivot(face &s1, face &s2);
922  inline void spivotself(face &s);
923  inline void sbond(face &s1, face &s2);
924  inline void sbond1(face &s1, face &s2);
925  inline void sdissolve(face &s);
926  inline point sorg(face &s);
927  inline point sdest(face &s);
928  inline point sapex(face &s);
929  inline void setsorg(face &s, point pointptr);
930  inline void setsdest(face &s, point pointptr);
931  inline void setsapex(face &s, point pointptr);
932  inline void sesym(face &s1, face &s2);
933  inline void sesymself(face &s);
934  inline void senext(face &s1, face &s2);
935  inline void senextself(face &s);
936  inline void senext2(face &s1, face &s2);
937  inline void senext2self(face &s);
938  inline REAL areabound(face &s);
939  inline void setareabound(face &s, REAL value);
940  inline int shellmark(face &s);
941  inline void setshellmark(face &s, int value);
942  inline void sinfect(face &s);
943  inline void suninfect(face &s);
944  inline bool sinfected(face &s);
945  inline void smarktest(face &s);
946  inline void sunmarktest(face &s);
947  inline bool smarktested(face &s);
948  inline void smarktest2(face &s);
949  inline void sunmarktest2(face &s);
950  inline bool smarktest2ed(face &s);
951  inline void smarktest3(face &s);
952  inline void sunmarktest3(face &s);
953  inline bool smarktest3ed(face &s);
954  inline void setfacetindex(face &f, int value);
955  inline int getfacetindex(face &f);
956 
957  // Primitives for interacting tetrahedra and subfaces.
958  inline void tsbond(triface &t, face &s);
959  inline void tsdissolve(triface &t);
960  inline void stdissolve(face &s);
961  inline void tspivot(triface &t, face &s);
962  inline void stpivot(face &s, triface &t);
963 
964  // Primitives for interacting tetrahedra and segments.
965  inline void tssbond1(triface &t, face &seg);
966  inline void sstbond1(face &s, triface &t);
967  inline void tssdissolve1(triface &t);
968  inline void sstdissolve1(face &s);
969  inline void tsspivot1(triface &t, face &s);
970  inline void sstpivot1(face &s, triface &t);
971 
972  // Primitives for interacting subfaces and segments.
973  inline void ssbond(face &s, face &edge);
974  inline void ssbond1(face &s, face &edge);
975  inline void ssdissolve(face &s);
976  inline void sspivot(face &s, face &edge);
977 
978  // Primitives for points.
979  inline int pointmark(point pt);
980  inline void setpointmark(point pt, int value);
981  inline enum verttype pointtype(point pt);
982  inline void setpointtype(point pt, enum verttype value);
983  inline int pointgeomtag(point pt);
984  inline void setpointgeomtag(point pt, int value);
985  inline REAL pointgeomuv(point pt, int i);
986  inline void setpointgeomuv(point pt, int i, REAL value);
987  inline void pinfect(point pt);
988  inline void puninfect(point pt);
989  inline bool pinfected(point pt);
990  inline void pmarktest(point pt);
991  inline void punmarktest(point pt);
992  inline bool pmarktested(point pt);
993  inline void pmarktest2(point pt);
994  inline void punmarktest2(point pt);
995  inline bool pmarktest2ed(point pt);
996  inline void pmarktest3(point pt);
997  inline void punmarktest3(point pt);
998  inline bool pmarktest3ed(point pt);
999  inline tetrahedron point2tet(point pt);
1000  inline void setpoint2tet(point pt, tetrahedron value);
1001  inline shellface point2sh(point pt);
1002  inline void setpoint2sh(point pt, shellface value);
1003  inline point point2ppt(point pt);
1004  inline void setpoint2ppt(point pt, point value);
1005  inline tetrahedron point2bgmtet(point pt);
1006  inline void setpoint2bgmtet(point pt, tetrahedron value);
1007  inline void setpointinsradius(point pt, REAL value);
1008  inline REAL getpointinsradius(point pt);
1009  inline bool issteinerpoint(point pt);
1010 
1011  // Advanced primitives.
1012  inline void point2tetorg(point pt, triface &t);
1013  inline void point2shorg(point pa, face &s);
1014  inline point farsorg(face &seg);
1015  inline point farsdest(face &seg);
1016 
1018  // //
1019  // Memory managment //
1020  // //
1022 
1028  void pointdealloc(point);
1029  point pointtraverse();
1030 
1031  void makeindex2pointmap(point *&);
1032  void makepoint2submap(memorypool *, int *&, face *&);
1033  void maketetrahedron(triface *);
1034  void makeshellface(memorypool *, face *);
1035  void makepoint(point *, enum verttype);
1036 
1037  void initializepools();
1038 
1040  // //
1041  // Advanced geometric predicates and calculations //
1042  // //
1043  // TetGen uses a simplified symbolic perturbation scheme from Edelsbrunner, //
1044  // et al [*]. Hence the point-in-sphere test never returns a zero. The idea
1045  // // is to perturb the weights of vertices in the fourth dimension. TetGen
1046  // // uses the indices of the vertices decide the amount of perturbation. It
1047  // is // implemented in the routine insphere_s().
1048  // //
1049  // The routine tri_edge_test() determines whether or not a triangle and an //
1050  // edge intersect in 3D. If they intersect, their intersection type is also //
1051  // reported. This test is a combination of n 3D orientation tests (n is bet-
1052  // // ween 3 and 9). It uses the robust orient3d() test to make the branch
1053  // dec- // isions. The routine tri_tri_test() determines whether or not two
1054  // triang- // les intersect in 3D. It also uses the robust orient3d() test.
1055  // //
1056  // //
1057  // There are a number of routines to calculate geometrical quantities, e.g.,
1058  // // circumcenters, angles, dihedral angles, face normals, face areas, etc.
1059  // // They are so far done by the default floating-point arithmetics which are
1060  // // non-robust. They should be improved in the future.
1061  // //
1062  // //
1064 
1065  // Symbolic perturbations (robust)
1066  REAL insphere_s(REAL *, REAL *, REAL *, REAL *, REAL *);
1067  REAL orient4d_s(REAL *, REAL *, REAL *, REAL *, REAL *, REAL, REAL, REAL,
1068  REAL, REAL);
1069 
1070  // Triangle-edge intersection test (robust)
1071  int tri_edge_2d(point, point, point, point, point, point, int, int *, int *);
1073  int *, int *);
1074  int tri_edge_test(point, point, point, point, point, point, int, int *,
1075  int *);
1076 
1077  // Triangle-triangle intersection test (robust)
1080 
1081  // Linear algebra functions
1082  inline REAL dot(REAL *v1, REAL *v2);
1083  inline void cross(REAL *v1, REAL *v2, REAL *n);
1084  bool lu_decmp(REAL lu[4][4], int n, int *ps, REAL *d, int N);
1085  void lu_solve(REAL lu[4][4], int n, int *ps, REAL *b, int N);
1086 
1087  // An embedded 2-dimensional geometric predicate (non-robust)
1088  REAL incircle3d(point pa, point pb, point pc, point pd);
1089 
1090  // Geometric calculations (non-robust)
1091  REAL orient3dfast(REAL *pa, REAL *pb, REAL *pc, REAL *pd);
1092  inline REAL norm2(REAL x, REAL y, REAL z);
1093  inline REAL distance(REAL *p1, REAL *p2);
1094  void facenormal(point pa, point pb, point pc, REAL *n, int pivot, REAL *lav);
1095  REAL shortdistance(REAL *p, REAL *e1, REAL *e2);
1096  REAL triarea(REAL *pa, REAL *pb, REAL *pc);
1097  REAL interiorangle(REAL *o, REAL *p1, REAL *p2, REAL *n);
1098  void projpt2edge(REAL *p, REAL *e1, REAL *e2, REAL *prj);
1099  void projpt2face(REAL *p, REAL *f1, REAL *f2, REAL *f3, REAL *prj);
1100  bool tetalldihedral(point, point, point, point, REAL *, REAL *, REAL *);
1101  void tetallnormal(point, point, point, point, REAL N[4][3], REAL *volume);
1103  bool circumsphere(REAL *, REAL *, REAL *, REAL *, REAL *cent, REAL *radius);
1104  bool orthosphere(REAL *, REAL *, REAL *, REAL *, REAL, REAL, REAL, REAL,
1105  REAL *, REAL *);
1106  void planelineint(REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *);
1107  int linelineint(REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *,
1108  REAL *);
1109  REAL tetprismvol(REAL *pa, REAL *pb, REAL *pc, REAL *pd);
1110  bool calculateabovepoint(arraypool *, point *, point *, point *);
1112 
1113  // PLC error reports.
1114  void report_overlapping_facets(face *, face *, REAL dihedang = 0.0);
1115  int report_selfint_edge(point, point, face *sedge, triface *searchtet,
1116  enum interresult);
1117  int report_selfint_face(point, point, point, face *sface, triface *iedge,
1118  int intflag, int *types, int *poss);
1119 
1121  // //
1122  // Local mesh transformations //
1123  // //
1124  // A local transformation replaces a small set of tetrahedra with another //
1125  // set of tetrahedra which fills the same space and the same boundaries. //
1126  // In 3D, the most simplest local transformations are the elementary flips
1127  // //
1128  // performed within the convex hull of five vertices: 2-to-3, 3-to-2,
1129  // 1-to-4,// and 4-to-1 flips, where the numbers indicate the number of
1130  // tetrahedra // before and after each flip. The 1-to-4 and 4-to-1 flip
1131  // involve inserting // or deleting a vertex, respectively.
1132  // //
1133  // There are complex local transformations which can be decomposed as a //
1134  // combination of elementary flips. For example,a 4-to-4 flip which replaces
1135  // // two coplanar edges can be regarded by a 2-to-3 flip and a 3-to-2 flip.
1136  // // Note that the first 2-to-3 flip will temporarily create a degenerate
1137  // tet- // rahedron which is removed immediately by the followed 3-to-2 flip.
1138  // More // generally, a n-to-m flip, where n > 3, m = (n - 2) * 2, which
1139  // removes an // edge can be done by first performing a sequence of (n - 3)
1140  // 2-to-3 flips // followed by a 3-to-2 flip.
1141  // //
1142  // //
1143  // The routines flip23(), flip32(), and flip41() perform the three element- //
1144  // ray flips. The flip14() is available inside the routine insertpoint(). //
1145  // //
1146  // The routines flipnm() and flipnm_post() implement a generalized edge flip
1147  // // algorithm which uses a combination of elementary flips.
1148  // //
1149  // //
1150  // The routine insertpoint() implements a variant of Bowyer-Watson's cavity //
1151  // algorithm to insert a vertex. It works for arbitrary tetrahedralization, //
1152  // either Delaunay, or constrained Delaunay, or non-Delaunay. //
1153  // //
1155 
1156  // The elementary flips.
1157  void flip23(triface *, int, flipconstraints *fc);
1158  void flip32(triface *, int, flipconstraints *fc);
1159  void flip41(triface *, int, flipconstraints *fc);
1160 
1161  // A generalized edge flip.
1162  int flipnm(triface *, int n, int level, int, flipconstraints *fc);
1163  int flipnm_post(triface *, int n, int nn, int, flipconstraints *fc);
1164 
1165  // Point insertion.
1168 
1170  // //
1171  // Delaunay tetrahedralization //
1172  // //
1173  // The routine incrementaldelaunay() implemented two incremental algorithms //
1174  // for constructing Delaunay tetrahedralizations (DTs): the Bowyer-Watson //
1175  // (B-W) algorithm and the incremental flip algorithm of Edelsbrunner and //
1176  // Shah, "Incremental topological flipping works for regular triangulation,"
1177  // // Algorithmica, 15:233-241, 1996.
1178  // //
1179  // //
1180  // The routine incrementalflip() implements the flip algorithm of [Edelsbru-
1181  // // nner and Shah, 1996]. It flips a queue of locally non-Delaunay faces
1182  // (in // an arbitrary order). The success is guaranteed when the Delaunay
1183  // tetrah- // edralization is constructed incrementally by adding one vertex
1184  // at a time. //
1185  // //
1186  // The routine locate() finds a tetrahedron contains a new point in current //
1187  // DT. It uses a simple stochastic walk algorithm: starting from an arbitr-
1188  // // ary tetrahedron in DT, it finds the destination by visit one tetrahedron
1189  // // at a time, randomly chooses a tetrahedron if there are more than one
1190  // // choices. This algorithm terminates due to Edelsbrunner's acyclic
1191  // theorem. //
1192  // Choose a good starting tetrahedron is crucial to the speed of the walk.
1193  // //
1194  // TetGen originally uses the "jump-and-walk" algorithm of Muecke, E.P., //
1195  // Saias, I., and Zhu, B. "Fast Randomized Point Location Without Preproces-
1196  // // sing." In Proceedings of the 12th ACM Symposium on Computational
1197  // Geometry,// 274-283, 1996. It first randomly samples several tetrahedra in
1198  // the DT // and then choosing the closet one to start walking.
1199  // //
1200  // The above algorithm slows download dramatically as the number of points
1201  // //
1202  // grows -- reported in Amenta, N., Choi, S. and Rote, G., "Incremental //
1203  // construction con {BRIO}," In Proceedings of 19th ACM Symposium on //
1204  // Computational Geometry, 211-219, 2003. On the other hand, Liu and //
1205  // Snoeyink showed that the point location can be made in constant time if //
1206  // the points are pre-sorted so that the nearby points in space have nearby //
1207  // indices, then adding the points in this order. They sorted the points //
1208  // along the 3D Hilbert curve. //
1209  // //
1210  // The routine hilbert_sort3() sorts a set of 3D points along the 3D Hilbert
1211  // // curve. It recursively splits a point set according to the Hilbert
1212  // indices // mapped to the subboxes of the bounding box of the point set.
1213  // //
1214  // The Hilbert indices is calculated by Butz's algorithm in 1971. A nice //
1215  // exposition of this algorithm can be found in the paper of Hamilton, C., //
1216  // "Compact Hilbert Indices", Technical Report CS-2006-07, Computer Science,
1217  // // Dalhousie University, 2006 (the Section 2). My implementation also
1218  // refer- // enced Steven Witham's implementation of "Hilbert walk"
1219  // (hopefully, it is // still available at:
1220  // http://www.tiac.net/~sw/2008/10/Hilbert/). //
1221  // //
1222  // TetGen sorts the points using the method in the paper of
1223  // Boissonnat,J.-D.,// Devillers, O. and Hornus, S. "Incremental Construction
1224  // of the Delaunay // Triangulation and the Delaunay Graph in Medium
1225  // Dimension," In Proceedings // of the 25th ACM Symposium on Computational
1226  // Geometry, 2009. //
1227  // It first randomly sorts the points into subgroups using the Biased
1228  // Rand-//
1229  // omized Insertion Ordering (BRIO) of Amenta et al 2003, then sorts the //
1230  // points in each subgroup along the 3D Hilbert curve. Inserting points in //
1231  // this order ensures a randomized "sprinkling" of the points over the //
1232  // domain, while sorting of each subset ensures locality. //
1233  // //
1235 
1237 
1238  // Point sorting.
1239  int transgc[8][3][8], tsb1mod3[8];
1240  void hilbert_init(int n);
1241  int hilbert_split(point *vertexarray, int arraysize, int gc0, int gc1, REAL,
1242  REAL, REAL, REAL, REAL, REAL);
1243  void hilbert_sort3(point *vertexarray, int arraysize, int e, int d, REAL,
1244  REAL, REAL, REAL, REAL, REAL, int depth);
1245  void brio_multiscale_sort(point *, int, int threshold, REAL ratio,
1246  int *depth);
1247 
1248  // Point location.
1249  unsigned long randomnation(unsigned int choices);
1250  void randomsample(point searchpt, triface *searchtet);
1251  enum locateresult locate(point searchpt, triface *searchtet,
1252  int chkencflag = 0);
1253 
1254  // Incremental flips.
1255  void flippush(badface *&, triface *);
1256  int incrementalflip(point newpt, int, flipconstraints *fc);
1257 
1258  // Incremental Delaunay construction.
1259  void initialdelaunay(point pa, point pb, point pc, point pd);
1260  void incrementaldelaunay(clock_t &);
1261 
1263  // //
1264  // Surface triangulation //
1265  // //
1267 
1268  void flipshpush(face *);
1269  void flip22(face *, int, int);
1270  void flip31(face *, int);
1271  long lawsonflip();
1272  int sinsertvertex(point newpt, face *, face *, int iloc, int bowywat, int);
1273  int sremovevertex(point delpt, face *, face *, int lawson);
1274 
1275  enum locateresult slocate(point, face *, int, int, int);
1276  enum interresult sscoutsegment(face *, point, int, int, int);
1277  void scarveholes(int, REAL *);
1278 
1279  void unifysegments();
1280  void identifyinputedges(point *);
1281  void mergefacets();
1282 
1283  enum interresult finddirection(triface *searchtet, point endpt);
1284 
1286  // //
1287  // Constrained tetrahedralizations. //
1288  // //
1290 
1291  int checkflipeligibility(int fliptype, point, point, point, point, point,
1292  int level, int edgepivot, flipconstraints *fc);
1293 
1296 
1297  int recoveredgebyflips(point, point, face *, triface *, int fullsearch);
1298  int add_steinerpt_in_schoenhardtpoly(triface *, int, int chkencflag);
1299  int add_steinerpt_in_segment(face *, int searchlevel);
1300  int addsteiner4recoversegment(face *, int);
1301  int recoversegments(arraypool *, int fullsearch, int steinerflag);
1302 
1304  int recoversubfaces(arraypool *, int steinerflag);
1305 
1306  int getvertexstar(int, point searchpt, arraypool *, arraypool *, arraypool *);
1307  int getedge(point, point, triface *);
1308  int reduceedgesatvertex(point startpt, arraypool *endptlist);
1309  int removevertexbyflips(point steinerpt);
1310 
1311  int suppressbdrysteinerpoint(point steinerpt);
1312  int suppresssteinerpoints();
1313 
1314  void recoverboundary(clock_t &);
1315 
1317  // //
1318  // Mesh reconstruction //
1319  // //
1321 
1322  void carveholes();
1323 
1324  // Comment: These three functions are implemented directly in:
1325  // src/mesh/meshGRegionBoundaryRecovery.cpp
1326  bool reconstructmesh(void *);
1327  void outsurfacemesh(const char *mfilename);
1328  void outmesh2medit(const char *mfilename);
1329 
1330  void enqueuesubface(memorypool *, face *);
1331  void enqueuetetrahedron(triface *);
1332 
1334  // //
1335  // Mesh optimization //
1336  // //
1338 
1340  void recoverdelaunay();
1341 
1343  long improvequalitybyflips();
1344 
1345  int smoothpoint(point smtpt, arraypool *, int ccw, optparameters *opm);
1347 
1348  int splitsliver(triface *, REAL, int);
1349  long removeslivers(int);
1350 
1351  void optimizemesh();
1352 
1353  void jettisonnodes();
1354 
1356  // //
1357  // Constructor & destructor //
1358  // //
1360 
1362  {
1363  in = addin = NULL;
1364  b = NULL;
1365  bgm = NULL;
1366 
1367  tetrahedrons = subfaces = subsegs = points = NULL;
1369  tet2segpool = tet2subpool = NULL;
1370  flippool = NULL;
1371 
1372  dummypoint = NULL;
1373  flipstack = NULL;
1374  unflipqueue = NULL;
1375 
1378  caveencshlist = caveencseglist = NULL;
1380 
1382  encseglist = encshlist = NULL;
1383  idx2facetlist = NULL;
1384  facetverticeslist = NULL;
1385  segmentendpointslist = NULL;
1386 
1387  highordertable = NULL;
1388 
1390  sizeoftensor = 0;
1391  pointmtrindex = 0;
1392  pointparamindex = 0;
1393  pointmarkindex = 0;
1394  point2simindex = 0;
1395  pointinsradiusindex = 0;
1396  elemattribindex = 0;
1397  volumeboundindex = 0;
1398  shmarkindex = 0;
1399  areaboundindex = 0;
1400  checksubsegflag = 0;
1401  checksubfaceflag = 0;
1402  checkconstraints = 0;
1403  nonconvex = 0;
1404  autofliplinklevel = 1;
1405  useinsertradius = 0;
1406  samples = 0l;
1407  randomseed = 1l;
1409  tetprism_vol_sum = 0.0;
1410  longest = minedgelength = 0.0;
1411  xmax = xmin = ymax = ymin = zmax = zmin = 0.0;
1412 
1413  insegments = 0l;
1414  hullsize = 0l;
1415  meshedges = meshhulledges = 0l;
1416  steinerleft = -1;
1417  dupverts = 0l;
1418  unuverts = 0l;
1419  nonregularcount = 0l;
1424  flip22count = flip31count = 0l;
1425  totalworkmemory = 0l;
1426 
1427  } // tetgenmesh()
1428 
1429  void freememory()
1430  {
1431  if(bgm != NULL) { delete bgm; }
1432 
1433  if(points != (memorypool *)NULL) {
1434  delete points;
1435  delete[] dummypoint;
1436  }
1437  if(tetrahedrons != (memorypool *)NULL) { delete tetrahedrons; }
1438  if(subfaces != (memorypool *)NULL) {
1439  delete subfaces;
1440  delete subsegs;
1441  }
1442  if(tet2segpool != NULL) {
1443  delete tet2segpool;
1444  delete tet2subpool;
1445  }
1446 
1447  if(badtetrahedrons) { delete badtetrahedrons; }
1448  if(badsubfacs) { delete badsubfacs; }
1449  if(badsubsegs) { delete badsubsegs; }
1450  if(encseglist) { delete encseglist; }
1451  if(encshlist) { delete encshlist; }
1452 
1453  if(flippool != NULL) {
1454  delete flippool;
1455  delete unflipqueue;
1456  }
1457 
1458  if(cavetetlist != NULL) {
1459  delete cavetetlist;
1460  delete cavebdrylist;
1461  delete caveoldtetlist;
1462  delete cavetetvertlist;
1463  }
1464 
1465  if(caveshlist != NULL) {
1466  delete caveshlist;
1467  delete caveshbdlist;
1468  delete cavesegshlist;
1469  delete cavetetshlist;
1470  delete cavetetseglist;
1471  delete caveencshlist;
1472  delete caveencseglist;
1473  }
1474 
1475  if(subsegstack != NULL) {
1476  delete subsegstack;
1477  delete subfacstack;
1478  delete subvertstack;
1479  }
1480 
1481  if(idx2facetlist != NULL) {
1482  delete[] idx2facetlist;
1483  delete[] facetverticeslist;
1484  }
1485 
1486  if(segmentendpointslist != NULL) { delete[] segmentendpointslist; }
1487 
1488  if(highordertable != NULL) { delete[] highordertable; }
1489 
1491  }
1492 
1494 
1495  ~tetgenmesh() { freememory(); } // ~tetgenmesh()
1496 
1497 }; // End of class tetgenmesh.
1498 
1500 // //
1501 // terminatetetgen() Terminate TetGen with a given exit code. //
1502 // //
1504 
1505 // selfint_event, a structure to report self-intersections.
1506 //
1507 // - e_type, report the type of self-intersections,
1508 // it may be one of:
1509 // 0, reserved.
1510 // 1, two edges intersect,
1511 // 2, an edge and a triangle intersect,
1512 // 3, two triangles intersect,
1513 // 4, two edges are overlapping,
1514 // 5, an edge and a triangle are overlapping,
1515 // 6, two triangles are overlapping,
1516 // 7, a vertex lies in an edge,
1517 // 8, a vertex lies in a facet,
1518 
1520 public:
1521  int e_type;
1522  int f_marker1; // Tag of the 1st facet.
1523  int s_marker1; // Tag of the 1st segment.
1524  int f_vertices1[3];
1525  int f_marker2; // Tag of the 2nd facet.
1526  int s_marker2; // Tag of the 2nd segment.
1527  int f_vertices2[3];
1530  {
1531  e_type = 0;
1532  f_marker1 = f_marker2 = 0;
1533  s_marker1 = s_marker2 = 0;
1534  }
1535 };
1536 
1538 
1539 inline void terminatetetgen(tetgenmesh *m, int x)
1540 {
1541 #ifdef TETLIBRARY
1542  throw x;
1543 #else
1544  switch(x) {
1545  case 1: // Out of memory.
1546  printf("Error: Out of memory.\n");
1547  break;
1548  case 2: // Encounter an internal error.
1549  printf("Please report this bug to Hang.Si@wias-berlin.de. Include\n");
1550  printf(" the message above, your input data set, and the exact\n");
1551  printf(" command line you used to run this program, thank you.\n");
1552  break;
1553  case 3:
1554  printf("A self-intersection was detected. Program stopped.\n");
1555  printf("Hint: use -d option to detect all self-intersections.\n");
1556  break;
1557  case 4:
1558  printf("A very small input feature size was detected. Program stopped.\n");
1559  if(m) {
1560  printf("Hint: use -T option to set a smaller tolerance. Current is %g\n",
1561  m->b->epsilon);
1562  }
1563  break;
1564  case 5:
1565  printf("Two very close input facets were detected. Program stopped.\n");
1566  printf("Hint: use -Y option to avoid adding Steiner points in boundary.\n");
1567  break;
1568  case 10: printf("An input error was detected. Program stopped.\n"); break;
1569  } // switch (x)
1570  exit(x);
1571 #endif // #ifdef TETLIBRARY
1572 }
1573 
1575 // //
1576 // Primitives for tetrahedra //
1577 // //
1579 
1580 // encode() compress a handle into a single pointer. It relies on the
1581 // assumption that all addresses of tetrahedra are aligned to sixteen-
1582 // byte boundaries, so that the last four significant bits are zero.
1583 
1585 {
1586  return (tetrahedron)((uintptr_t)(t).tet | (uintptr_t)(t).ver);
1587 }
1588 
1590 {
1591  return (tetrahedron)((uintptr_t)(ptr) | (uintptr_t)(ver));
1592 }
1593 
1594 // decode() converts a pointer to a handle. The version is extracted from
1595 // the four least significant bits of the pointer.
1596 
1598 {
1599  (t).ver = (int)((uintptr_t)(ptr) & (uintptr_t)15);
1600  (t).tet = (tetrahedron *)((uintptr_t)(ptr) ^ (uintptr_t)(t).ver);
1601 }
1602 
1603 // bond() connects two tetrahedra together. (t1,v1) and (t2,v2) must
1604 // refer to the same face and the same edge.
1605 
1606 inline void tetgenmesh::bond(triface &t1, triface &t2)
1607 {
1608  t1.tet[t1.ver & 3] = encode2(t2.tet, bondtbl[t1.ver][t2.ver]);
1609  t2.tet[t2.ver & 3] = encode2(t1.tet, bondtbl[t2.ver][t1.ver]);
1610 }
1611 
1612 // dissolve() a bond (from one side).
1613 
1614 inline void tetgenmesh::dissolve(triface &t) { t.tet[t.ver & 3] = NULL; }
1615 
1616 // enext() finds the next edge (counterclockwise) in the same face.
1617 
1618 inline void tetgenmesh::enext(triface &t1, triface &t2)
1619 {
1620  t2.tet = t1.tet;
1621  t2.ver = enexttbl[t1.ver];
1622 }
1623 
1624 inline void tetgenmesh::enextself(triface &t) { t.ver = enexttbl[t.ver]; }
1625 
1626 // eprev() finds the next edge (clockwise) in the same face.
1627 
1628 inline void tetgenmesh::eprev(triface &t1, triface &t2)
1629 {
1630  t2.tet = t1.tet;
1631  t2.ver = eprevtbl[t1.ver];
1632 }
1633 
1634 inline void tetgenmesh::eprevself(triface &t) { t.ver = eprevtbl[t.ver]; }
1635 
1636 // esym() finds the reversed edge. It is in the other face of the
1637 // same tetrahedron.
1638 
1639 inline void tetgenmesh::esym(triface &t1, triface &t2)
1640 {
1641  (t2).tet = (t1).tet;
1642  (t2).ver = esymtbl[(t1).ver];
1643 }
1644 
1645 inline void tetgenmesh::esymself(triface &t) { (t).ver = esymtbl[(t).ver]; }
1646 
1647 // enextesym() finds the reversed edge of the next edge. It is in the other
1648 // face of the same tetrahedron. It is the combination esym() * enext().
1649 
1651 {
1652  t2.tet = t1.tet;
1653  t2.ver = enextesymtbl[t1.ver];
1654 }
1655 
1657 {
1658  t.ver = enextesymtbl[t.ver];
1659 }
1660 
1661 // eprevesym() finds the reversed edge of the previous edge.
1662 
1664 {
1665  t2.tet = t1.tet;
1666  t2.ver = eprevesymtbl[t1.ver];
1667 }
1668 
1670 {
1671  t.ver = eprevesymtbl[t.ver];
1672 }
1673 
1674 // eorgoppo() Finds the opposite face of the origin of the current edge.
1675 // Return the opposite edge of the current edge.
1676 
1677 inline void tetgenmesh::eorgoppo(triface &t1, triface &t2)
1678 {
1679  t2.tet = t1.tet;
1680  t2.ver = eorgoppotbl[t1.ver];
1681 }
1682 
1684 
1685 // edestoppo() Finds the opposite face of the destination of the current
1686 // edge. Return the opposite edge of the current edge.
1687 
1689 {
1690  t2.tet = t1.tet;
1691  t2.ver = edestoppotbl[t1.ver];
1692 }
1693 
1695 {
1696  t.ver = edestoppotbl[t.ver];
1697 }
1698 
1699 // fsym() finds the adjacent tetrahedron at the same face and the same edge.
1700 
1701 inline void tetgenmesh::fsym(triface &t1, triface &t2)
1702 {
1703  decode((t1).tet[(t1).ver & 3], t2);
1704  t2.ver = fsymtbl[t1.ver][t2.ver];
1705 }
1706 
1707 #define fsymself(t) \
1708  t1ver = (t).ver; \
1709  decode((t).tet[(t).ver & 3], (t)); \
1710  (t).ver = fsymtbl[t1ver][(t).ver]
1711 
1712 // fnext() finds the next face while rotating about an edge according to
1713 // a right-hand rule. The face is in the adjacent tetrahedron. It is
1714 // the combination: fsym() * esym().
1715 
1716 inline void tetgenmesh::fnext(triface &t1, triface &t2)
1717 {
1718  decode(t1.tet[facepivot1[t1.ver]], t2);
1719  t2.ver = facepivot2[t1.ver][t2.ver];
1720 }
1721 
1722 #define fnextself(t) \
1723  t1ver = (t).ver; \
1724  decode((t).tet[facepivot1[(t).ver]], (t)); \
1725  (t).ver = facepivot2[t1ver][(t).ver]
1726 
1727 // The following primtives get or set the origin, destination, face apex,
1728 // or face opposite of an ordered tetrahedron.
1729 
1731 {
1732  return (point)(t).tet[orgpivot[(t).ver]];
1733 }
1734 
1736 {
1737  return (point)(t).tet[destpivot[(t).ver]];
1738 }
1739 
1741 {
1742  return (point)(t).tet[apexpivot[(t).ver]];
1743 }
1744 
1746 {
1747  return (point)(t).tet[oppopivot[(t).ver]];
1748 }
1749 
1751 {
1752  (t).tet[orgpivot[(t).ver]] = (tetrahedron)(p);
1753 }
1754 
1756 {
1757  (t).tet[destpivot[(t).ver]] = (tetrahedron)(p);
1758 }
1759 
1761 {
1762  (t).tet[apexpivot[(t).ver]] = (tetrahedron)(p);
1763 }
1764 
1766 {
1767  (t).tet[oppopivot[(t).ver]] = (tetrahedron)(p);
1768 }
1769 
1770 #define setvertices(t, torg, tdest, tapex, toppo) \
1771  (t).tet[orgpivot[(t).ver]] = (tetrahedron)(torg); \
1772  (t).tet[destpivot[(t).ver]] = (tetrahedron)(tdest); \
1773  (t).tet[apexpivot[(t).ver]] = (tetrahedron)(tapex); \
1774  (t).tet[oppopivot[(t).ver]] = (tetrahedron)(toppo)
1775 
1776 // Check or set a tetrahedron's attributes.
1777 
1779 {
1780  return ((REAL *)(ptr))[elemattribindex + attnum];
1781 }
1782 
1783 inline void tetgenmesh::setelemattribute(tetrahedron *ptr, int attnum,
1784  REAL value)
1785 {
1786  ((REAL *)(ptr))[elemattribindex + attnum] = value;
1787 }
1788 
1789 // Check or set a tetrahedron's maximum volume bound.
1790 
1792 {
1793  return ((REAL *)(ptr))[volumeboundindex];
1794 }
1795 
1797 {
1798  ((REAL *)(ptr))[volumeboundindex] = value;
1799 }
1800 
1801 // Get or set a tetrahedron's index (only used for output).
1802 // These two routines use the reserved slot ptr[10].
1803 
1805 {
1806  int *iptr = (int *)&(ptr[10]);
1807  return iptr[0];
1808 }
1809 
1810 inline void tetgenmesh::setelemindex(tetrahedron *ptr, int value)
1811 {
1812  int *iptr = (int *)&(ptr[10]);
1813  iptr[0] = value;
1814 }
1815 
1816 // Get or set a tetrahedron's marker.
1817 // Set 'value = 0' cleans all the face/edge flags.
1818 
1820 {
1821  return ((int *)(ptr))[elemmarkerindex];
1822 }
1823 
1824 inline void tetgenmesh::setelemmarker(tetrahedron *ptr, int value)
1825 {
1826  ((int *)(ptr))[elemmarkerindex] = value;
1827 }
1828 
1829 // infect(), infected(), uninfect() -- primitives to flag or unflag a
1830 // tetrahedron. The last bit of the element marker is flagged (1)
1831 // or unflagged (0).
1832 
1834 {
1835  ((int *)(t.tet))[elemmarkerindex] |= 1;
1836 }
1837 
1839 {
1840  ((int *)(t.tet))[elemmarkerindex] &= ~1;
1841 }
1842 
1844 {
1845  return (((int *)(t.tet))[elemmarkerindex] & 1) != 0;
1846 }
1847 
1848 // marktest(), marktested(), unmarktest() -- primitives to flag or unflag a
1849 // tetrahedron. Use the second lowerest bit of the element marker.
1850 
1852 {
1853  ((int *)(t.tet))[elemmarkerindex] |= 2;
1854 }
1855 
1857 {
1858  ((int *)(t.tet))[elemmarkerindex] &= ~2;
1859 }
1860 
1862 {
1863  return (((int *)(t.tet))[elemmarkerindex] & 2) != 0;
1864 }
1865 
1866 // markface(), unmarkface(), facemarked() -- primitives to flag or unflag a
1867 // face of a tetrahedron. From the last 3rd to 6th bits are used for
1868 // face markers, e.g., the last third bit corresponds to loc = 0.
1869 
1871 {
1872  ((int *)(t.tet))[elemmarkerindex] |= (4 << (t.ver & 3));
1873 }
1874 
1876 {
1877  ((int *)(t.tet))[elemmarkerindex] &= ~(4 << (t.ver & 3));
1878 }
1879 
1881 {
1882  return (((int *)(t.tet))[elemmarkerindex] & (4 << (t.ver & 3))) != 0;
1883 }
1884 
1885 // markedge(), unmarkedge(), edgemarked() -- primitives to flag or unflag an
1886 // edge of a tetrahedron. From the last 7th to 12th bits are used for
1887 // edge markers, e.g., the last 7th bit corresponds to the 0th edge, etc.
1888 // Remark: The last 7th bit is marked by 2^6 = 64.
1889 
1891 {
1892  ((int *)(t.tet))[elemmarkerindex] |= (int)(64 << ver2edge[(t).ver]);
1893 }
1894 
1896 {
1897  ((int *)(t.tet))[elemmarkerindex] &= ~(int)(64 << ver2edge[(t).ver]);
1898 }
1899 
1901 {
1902  return (((int *)(t.tet))[elemmarkerindex] & (int)(64 << ver2edge[(t).ver])) !=
1903  0;
1904 }
1905 
1906 // marktest2(), unmarktest2(), marktest2ed() -- primitives to flag and unflag
1907 // a tetrahedron. The 13th bit (2^12 = 4096) is used for this flag.
1908 
1910 {
1911  ((int *)(t.tet))[elemmarkerindex] |= (int)(4096);
1912 }
1913 
1915 {
1916  ((int *)(t.tet))[elemmarkerindex] &= ~(int)(4096);
1917 }
1918 
1920 {
1921  return (((int *)(t.tet))[elemmarkerindex] & (int)(4096)) != 0;
1922 }
1923 
1924 // elemcounter(), setelemcounter() -- primitives to read or ser a (small)
1925 // integer counter in this tet. It is saved from the 16th bit. On 32 bit
1926 // system, the range of the counter is [0, 2^15 = 32768].
1927 
1929 {
1930  return (((int *)(t.tet))[elemmarkerindex]) >> 16;
1931 }
1932 
1933 inline void tetgenmesh::setelemcounter(triface &t, int value)
1934 {
1935  int c = ((int *)(t.tet))[elemmarkerindex];
1936  // Clear the old counter while keep the other flags.
1937  c &= 65535; // sum_{i=0^15} 2^i
1938  c |= (value << 16);
1939  ((int *)(t.tet))[elemmarkerindex] = c;
1940 }
1941 
1943 {
1944  int c = elemcounter(t);
1945  setelemcounter(t, c + 1);
1946 }
1947 
1949 {
1950  int c = elemcounter(t);
1951  setelemcounter(t, c - 1);
1952 }
1953 
1954 // ishulltet() tests if t is a hull tetrahedron.
1955 
1957 {
1958  return (point)(t).tet[7] == dummypoint;
1959 }
1960 
1961 // isdeadtet() tests if t is a tetrahedron is dead.
1962 
1964 {
1965  return ((t.tet == NULL) || (t.tet[4] == NULL));
1966 }
1967 
1969 // //
1970 // Primitives for subfaces and subsegments //
1971 // //
1973 
1974 // Each subface contains three pointers to its neighboring subfaces, with
1975 // edge versions. To save memory, both information are kept in a single
1976 // pointer. To make this possible, all subfaces are aligned to eight-byte
1977 // boundaries, so that the last three bits of each pointer are zeros. An
1978 // edge version (in the range 0 to 5) is compressed into the last three
1979 // bits of each pointer by 'sencode()'. 'sdecode()' decodes a pointer,
1980 // extracting an edge version and a pointer to the beginning of a subface.
1981 
1982 inline void tetgenmesh::sdecode(shellface sptr, face &s)
1983 {
1984  s.shver = (int)((uintptr_t)(sptr) & (uintptr_t)7);
1985  s.sh = (shellface *)((uintptr_t)(sptr) ^ (uintptr_t)(s.shver));
1986 }
1987 
1989 {
1990  return (shellface)((uintptr_t)s.sh | (uintptr_t)s.shver);
1991 }
1992 
1994 {
1995  return (shellface)((uintptr_t)sh | (uintptr_t)shver);
1996 }
1997 
1998 // sbond() bonds two subfaces (s1) and (s2) together. s1 and s2 must refer
1999 // to the same edge. No requirement is needed on their orientations.
2000 
2001 inline void tetgenmesh::sbond(face &s1, face &s2)
2002 {
2003  s1.sh[s1.shver >> 1] = sencode(s2);
2004  s2.sh[s2.shver >> 1] = sencode(s1);
2005 }
2006 
2007 // sbond1() bonds s1 <== s2, i.e., after bonding, s1 is pointing to s2,
2008 // but s2 is not pointing to s1. s1 and s2 must refer to the same edge.
2009 // No requirement is needed on their orientations.
2010 
2011 inline void tetgenmesh::sbond1(face &s1, face &s2)
2012 {
2013  s1.sh[s1.shver >> 1] = sencode(s2);
2014 }
2015 
2016 // Dissolve a subface bond (from one side). Note that the other subface
2017 // will still think it's connected to this subface.
2018 
2019 inline void tetgenmesh::sdissolve(face &s) { s.sh[s.shver >> 1] = NULL; }
2020 
2021 // spivot() finds the adjacent subface (s2) for a given subface (s1).
2022 // s1 and s2 share at the same edge.
2023 
2024 inline void tetgenmesh::spivot(face &s1, face &s2)
2025 {
2026  shellface sptr = s1.sh[s1.shver >> 1];
2027  sdecode(sptr, s2);
2028 }
2029 
2031 {
2032  shellface sptr = s.sh[s.shver >> 1];
2033  sdecode(sptr, s);
2034 }
2035 
2036 // These primitives determine or set the origin, destination, or apex
2037 // of a subface with respect to the edge version.
2038 
2040 {
2041  return (point)s.sh[sorgpivot[s.shver]];
2042 }
2043 
2045 {
2046  return (point)s.sh[sdestpivot[s.shver]];
2047 }
2048 
2050 {
2051  return (point)s.sh[sapexpivot[s.shver]];
2052 }
2053 
2054 inline void tetgenmesh::setsorg(face &s, point pointptr)
2055 {
2056  s.sh[sorgpivot[s.shver]] = (shellface)pointptr;
2057 }
2058 
2059 inline void tetgenmesh::setsdest(face &s, point pointptr)
2060 {
2061  s.sh[sdestpivot[s.shver]] = (shellface)pointptr;
2062 }
2063 
2064 inline void tetgenmesh::setsapex(face &s, point pointptr)
2065 {
2066  s.sh[sapexpivot[s.shver]] = (shellface)pointptr;
2067 }
2068 
2069 #define setshvertices(s, pa, pb, pc) \
2070  setsorg(s, pa); \
2071  setsdest(s, pb); \
2072  setsapex(s, pc)
2073 
2074 // sesym() reserves the direction of the lead edge.
2075 
2076 inline void tetgenmesh::sesym(face &s1, face &s2)
2077 {
2078  s2.sh = s1.sh;
2079  s2.shver = (s1.shver ^ 1); // Inverse the last bit.
2080 }
2081 
2082 inline void tetgenmesh::sesymself(face &s) { s.shver ^= 1; }
2083 
2084 // senext() finds the next edge (counterclockwise) in the same orientation
2085 // of this face.
2086 
2087 inline void tetgenmesh::senext(face &s1, face &s2)
2088 {
2089  s2.sh = s1.sh;
2090  s2.shver = snextpivot[s1.shver];
2091 }
2092 
2093 inline void tetgenmesh::senextself(face &s) { s.shver = snextpivot[s.shver]; }
2094 
2095 inline void tetgenmesh::senext2(face &s1, face &s2)
2096 {
2097  s2.sh = s1.sh;
2098  s2.shver = snextpivot[snextpivot[s1.shver]];
2099 }
2100 
2102 {
2103  s.shver = snextpivot[snextpivot[s.shver]];
2104 }
2105 
2106 // Check or set a subface's maximum area bound.
2107 
2109 {
2110  return ((REAL *)(s.sh))[areaboundindex];
2111 }
2112 
2113 inline void tetgenmesh::setareabound(face &s, REAL value)
2114 {
2115  ((REAL *)(s.sh))[areaboundindex] = value;
2116 }
2117 
2118 // These two primitives read or set a shell marker. Shell markers are used
2119 // to hold user boundary information.
2120 
2122 {
2123  return ((int *)(s.sh))[shmarkindex];
2124 }
2125 
2126 inline void tetgenmesh::setshellmark(face &s, int value)
2127 {
2128  ((int *)(s.sh))[shmarkindex] = value;
2129 }
2130 
2131 // sinfect(), sinfected(), suninfect() -- primitives to flag or unflag a
2132 // subface. The last bit of ((int *) ((s).sh))[shmarkindex+1] is flagged.
2133 
2134 inline void tetgenmesh::sinfect(face &s)
2135 {
2136  ((int *)((s).sh))[shmarkindex + 1] =
2137  (((int *)((s).sh))[shmarkindex + 1] | (int)1);
2138 }
2139 
2141 {
2142  ((int *)((s).sh))[shmarkindex + 1] =
2143  (((int *)((s).sh))[shmarkindex + 1] & ~(int)1);
2144 }
2145 
2146 // Test a subface for viral infection.
2147 
2149 {
2150  return (((int *)((s).sh))[shmarkindex + 1] & (int)1) != 0;
2151 }
2152 
2153 // smarktest(), smarktested(), sunmarktest() -- primitives to flag or unflag
2154 // a subface. The last 2nd bit of the integer is flagged.
2155 
2157 {
2158  ((int *)((s).sh))[shmarkindex + 1] =
2159  (((int *)((s).sh))[shmarkindex + 1] | (int)2);
2160 }
2161 
2163 {
2164  ((int *)((s).sh))[shmarkindex + 1] =
2165  (((int *)((s).sh))[shmarkindex + 1] & ~(int)2);
2166 }
2167 
2169 {
2170  return ((((int *)((s).sh))[shmarkindex + 1] & (int)2) != 0);
2171 }
2172 
2173 // smarktest2(), smarktest2ed(), sunmarktest2() -- primitives to flag or
2174 // unflag a subface. The last 3rd bit of the integer is flagged.
2175 
2177 {
2178  ((int *)((s).sh))[shmarkindex + 1] =
2179  (((int *)((s).sh))[shmarkindex + 1] | (int)4);
2180 }
2181 
2183 {
2184  ((int *)((s).sh))[shmarkindex + 1] =
2185  (((int *)((s).sh))[shmarkindex + 1] & ~(int)4);
2186 }
2187 
2189 {
2190  return ((((int *)((s).sh))[shmarkindex + 1] & (int)4) != 0);
2191 }
2192 
2193 // The last 4th bit of ((int *) ((s).sh))[shmarkindex+1] is flagged.
2194 
2196 {
2197  ((int *)((s).sh))[shmarkindex + 1] =
2198  (((int *)((s).sh))[shmarkindex + 1] | (int)8);
2199 }
2200 
2202 {
2203  ((int *)((s).sh))[shmarkindex + 1] =
2204  (((int *)((s).sh))[shmarkindex + 1] & ~(int)8);
2205 }
2206 
2208 {
2209  return ((((int *)((s).sh))[shmarkindex + 1] & (int)8) != 0);
2210 }
2211 
2212 // Each facet has a unique index (automatically indexed). Starting from '0'.
2213 // We save this index in the same field of the shell type.
2214 
2215 inline void tetgenmesh::setfacetindex(face &s, int value)
2216 {
2217  ((int *)(s.sh))[shmarkindex + 2] = value;
2218 }
2219 
2221 {
2222  return ((int *)(s.sh))[shmarkindex + 2];
2223 }
2224 
2226 // //
2227 // Primitives for interacting between tetrahedra and subfaces //
2228 // //
2230 
2231 // tsbond() bond a tetrahedron (t) and a subface (s) together.
2232 // Note that t and s must be the same face and the same edge. Moreover,
2233 // t and s have the same orientation.
2234 // Since the edge number in t and in s can be any number in {0,1,2}. We bond
2235 // the edge in s which corresponds to t's 0th edge, and vice versa.
2236 
2237 inline void tetgenmesh::tsbond(triface &t, face &s)
2238 {
2239  if((t).tet[9] == NULL) {
2240  // Allocate space for this tet.
2241  (t).tet[9] = (tetrahedron)tet2subpool->alloc();
2242  // Initialize.
2243  for(int i = 0; i < 4; i++) { ((shellface *)(t).tet[9])[i] = NULL; }
2244  }
2245  // Bond t <== s.
2246  ((shellface *)(t).tet[9])[(t).ver & 3] =
2247  sencode2((s).sh, tsbondtbl[t.ver][s.shver]);
2248  // Bond s <== t.
2249  s.sh[9 + ((s).shver & 1)] =
2250  (shellface)encode2((t).tet, stbondtbl[t.ver][s.shver]);
2251 }
2252 
2253 // tspivot() finds a subface (s) abutting on the given tetrahdera (t).
2254 // Return s.sh = NULL if there is no subface at t. Otherwise, return
2255 // the subface s, and s and t must be at the same edge wth the same
2256 // orientation.
2257 
2258 inline void tetgenmesh::tspivot(triface &t, face &s)
2259 {
2260  if((t).tet[9] == NULL) {
2261  (s).sh = NULL;
2262  return;
2263  }
2264  // Get the attached subface s.
2265  sdecode(((shellface *)(t).tet[9])[(t).ver & 3], (s));
2266  (s).shver = tspivottbl[t.ver][s.shver];
2267 }
2268 
2269 // Quickly check if the handle (t, v) is a subface.
2270 #define issubface(t) ((t).tet[9] && ((t).tet[9])[(t).ver & 3])
2272 // stpivot() finds a tetrahedron (t) abutting a given subface (s).
2273 // Return the t (if it exists) with the same edge and the same
2274 // orientation of s.
2275 
2276 inline void tetgenmesh::stpivot(face &s, triface &t)
2277 {
2278  decode((tetrahedron)s.sh[9 + (s.shver & 1)], t);
2279  if((t).tet == NULL) { return; }
2280  (t).ver = stpivottbl[t.ver][s.shver];
2281 }
2282 
2283 // Quickly check if this subface is attached to a tetrahedron.
2284 
2285 #define isshtet(s) ((s).sh[9 + ((s).shver & 1)])
2287 // tsdissolve() dissolve a bond (from the tetrahedron side).
2288 
2290 {
2291  if((t).tet[9] != NULL) { ((shellface *)(t).tet[9])[(t).ver & 3] = NULL; }
2292 }
2293 
2294 // stdissolve() dissolve a bond (from the subface side).
2295 
2297 {
2298  (s).sh[9] = NULL;
2299  (s).sh[10] = NULL;
2300 }
2301 
2303 // //
2304 // Primitives for interacting between subfaces and segments //
2305 // //
2307 
2308 // ssbond() bond a subface to a subsegment.
2309 
2310 inline void tetgenmesh::ssbond(face &s, face &edge)
2311 {
2312  s.sh[6 + (s.shver >> 1)] = sencode(edge);
2313  edge.sh[0] = sencode(s);
2314 }
2315 
2316 inline void tetgenmesh::ssbond1(face &s, face &edge)
2317 {
2318  s.sh[6 + (s.shver >> 1)] = sencode(edge);
2319  // edge.sh[0] = sencode(s);
2320 }
2321 
2322 // ssdisolve() dissolve a bond (from the subface side)
2323 
2324 inline void tetgenmesh::ssdissolve(face &s) { s.sh[6 + (s.shver >> 1)] = NULL; }
2325 
2326 // sspivot() finds a subsegment abutting a subface.
2327 
2328 inline void tetgenmesh::sspivot(face &s, face &edge)
2329 {
2330  sdecode((shellface)s.sh[6 + (s.shver >> 1)], edge);
2331 }
2332 
2333 // Quickly check if the edge is a subsegment.
2334 
2335 #define isshsubseg(s) ((s).sh[6 + ((s).shver >> 1)])
2338 // //
2339 // Primitives for interacting between tetrahedra and segments //
2340 // //
2342 
2343 inline void tetgenmesh::tssbond1(triface &t, face &s)
2344 {
2345  if((t).tet[8] == NULL) {
2346  // Allocate space for this tet.
2347  (t).tet[8] = (tetrahedron)tet2segpool->alloc();
2348  // Initialization.
2349  for(int i = 0; i < 6; i++) { ((shellface *)(t).tet[8])[i] = NULL; }
2350  }
2351  ((shellface *)(t).tet[8])[ver2edge[(t).ver]] = sencode((s));
2352 }
2353 
2354 inline void tetgenmesh::sstbond1(face &s, triface &t)
2355 {
2356  ((tetrahedron *)(s).sh)[9] = encode(t);
2357 }
2358 
2360 {
2361  if((t).tet[8] != NULL) {
2362  ((shellface *)(t).tet[8])[ver2edge[(t).ver]] = NULL;
2363  }
2364 }
2365 
2367 {
2368  ((tetrahedron *)(s).sh)[9] = NULL;
2369 }
2370 
2372 {
2373  if((t).tet[8] != NULL) {
2374  sdecode(((shellface *)(t).tet[8])[ver2edge[(t).ver]], s);
2375  }
2376  else {
2377  (s).sh = NULL;
2378  }
2379 }
2380 
2381 // Quickly check whether 't' is a segment or not.
2382 
2383 #define issubseg(t) ((t).tet[8] && ((t).tet[8])[ver2edge[(t).ver]])
2386 {
2387  decode((tetrahedron)s.sh[9], t);
2388 }
2389 
2391 // //
2392 // Primitives for points //
2393 // //
2395 
2397 {
2398  return ((int *)(pt))[pointmarkindex];
2399 }
2400 
2401 inline void tetgenmesh::setpointmark(point pt, int value)
2402 {
2403  ((int *)(pt))[pointmarkindex] = value;
2404 }
2405 
2406 // These two primitives set and read the type of the point.
2407 
2408 inline enum tetgenmesh::verttype tetgenmesh::pointtype(point pt)
2409 {
2410  return (enum verttype)(((int *)(pt))[pointmarkindex + 1] >> (int)8);
2411 }
2412 
2413 inline void tetgenmesh::setpointtype(point pt, enum verttype value)
2414 {
2415  ((int *)(pt))[pointmarkindex + 1] =
2416  ((int)value << 8) + (((int *)(pt))[pointmarkindex + 1] & (int)255);
2417 }
2418 
2419 // Read and set the geometry tag of the point (used by -s option).
2420 
2422 {
2423  return ((int *)(pt))[pointmarkindex + 2];
2424 }
2425 
2426 inline void tetgenmesh::setpointgeomtag(point pt, int value)
2427 {
2428  ((int *)(pt))[pointmarkindex + 2] = value;
2429 }
2430 
2431 // Read and set the u,v coordinates of the point (used by -s option).
2432 
2434 {
2435  return pt[pointparamindex + i];
2436 }
2437 
2438 inline void tetgenmesh::setpointgeomuv(point pt, int i, REAL value)
2439 {
2440  pt[pointparamindex + i] = value;
2441 }
2442 
2443 // pinfect(), puninfect(), pinfected() -- primitives to flag or unflag
2444 // a point. The last bit of the integer '[pointindex+1]' is flagged.
2445 
2447 {
2448  ((int *)(pt))[pointmarkindex + 1] |= (int)1;
2449 }
2450 
2452 {
2453  ((int *)(pt))[pointmarkindex + 1] &= ~(int)1;
2454 }
2455 
2457 {
2458  return (((int *)(pt))[pointmarkindex + 1] & (int)1) != 0;
2459 }
2460 
2461 // pmarktest(), punmarktest(), pmarktested() -- more primitives to
2462 // flag or unflag a point.
2463 
2465 {
2466  ((int *)(pt))[pointmarkindex + 1] |= (int)2;
2467 }
2468 
2470 {
2471  ((int *)(pt))[pointmarkindex + 1] &= ~(int)2;
2472 }
2473 
2475 {
2476  return (((int *)(pt))[pointmarkindex + 1] & (int)2) != 0;
2477 }
2478 
2480 {
2481  ((int *)(pt))[pointmarkindex + 1] |= (int)4;
2482 }
2483 
2485 {
2486  ((int *)(pt))[pointmarkindex + 1] &= ~(int)4;
2487 }
2488 
2490 {
2491  return (((int *)(pt))[pointmarkindex + 1] & (int)4) != 0;
2492 }
2493 
2495 {
2496  ((int *)(pt))[pointmarkindex + 1] |= (int)8;
2497 }
2498 
2500 {
2501  ((int *)(pt))[pointmarkindex + 1] &= ~(int)8;
2502 }
2503 
2505 {
2506  return (((int *)(pt))[pointmarkindex + 1] & (int)8) != 0;
2507 }
2508 
2509 // These following primitives set and read a pointer to a tetrahedron
2510 // a subface/subsegment, a point, or a tet of background mesh.
2511 
2513 {
2514  return ((tetrahedron *)(pt))[point2simindex];
2515 }
2516 
2518 {
2519  ((tetrahedron *)(pt))[point2simindex] = value;
2520 }
2521 
2523 {
2524  return (point)((tetrahedron *)(pt))[point2simindex + 1];
2525 }
2526 
2527 inline void tetgenmesh::setpoint2ppt(point pt, point value)
2528 {
2529  ((tetrahedron *)(pt))[point2simindex + 1] = (tetrahedron)value;
2530 }
2531 
2533 {
2534  return (shellface)((tetrahedron *)(pt))[point2simindex + 2];
2535 }
2536 
2538 {
2539  ((tetrahedron *)(pt))[point2simindex + 2] = (tetrahedron)value;
2540 }
2541 
2543 {
2544  return ((tetrahedron *)(pt))[point2simindex + 3];
2545 }
2546 
2548 {
2549  ((tetrahedron *)(pt))[point2simindex + 3] = value;
2550 }
2551 
2552 // The primitives for saving and getting the insertion radius.
2554 {
2555  pt[pointinsradiusindex] = value;
2556 }
2557 
2559 {
2560  return pt[pointinsradiusindex];
2561 }
2562 
2564 {
2565  return (pointtype(pt) == FREESEGVERTEX) ||
2566  (pointtype(pt) == FREEFACETVERTEX) || (pointtype(pt) == FREEVOLVERTEX);
2567 }
2568 
2569 // point2tetorg() Get the tetrahedron whose origin is the point.
2570 
2571 inline void tetgenmesh::point2tetorg(point pa, triface &searchtet)
2572 {
2573  decode(point2tet(pa), searchtet);
2574  if((point)searchtet.tet[4] == pa) { searchtet.ver = 11; }
2575  else if((point)searchtet.tet[5] == pa) {
2576  searchtet.ver = 3;
2577  }
2578  else if((point)searchtet.tet[6] == pa) {
2579  searchtet.ver = 7;
2580  }
2581  else {
2582  searchtet.ver = 0;
2583  }
2584 }
2585 
2586 // point2shorg() Get the subface/segment whose origin is the point.
2587 
2588 inline void tetgenmesh::point2shorg(point pa, face &searchsh)
2589 {
2590  sdecode(point2sh(pa), searchsh);
2591  if((point)searchsh.sh[3] == pa) { searchsh.shver = 0; }
2592  else if((point)searchsh.sh[4] == pa) {
2593  searchsh.shver = (searchsh.sh[5] != NULL ? 2 : 1);
2594  }
2595  else {
2596  searchsh.shver = 4;
2597  }
2598 }
2599 
2600 // farsorg() Return the origin of the subsegment.
2601 // farsdest() Return the destination of the subsegment.
2602 
2604 {
2605  face travesh, neighsh;
2606 
2607  travesh = s;
2608  while(1) {
2609  senext2(travesh, neighsh);
2610  spivotself(neighsh);
2611  if(neighsh.sh == NULL) break;
2612  if(sorg(neighsh) != sorg(travesh)) sesymself(neighsh);
2613  senext2(neighsh, travesh);
2614  }
2615  return sorg(travesh);
2616 }
2617 
2619 {
2620  face travesh, neighsh;
2621 
2622  travesh = s;
2623  while(1) {
2624  senext(travesh, neighsh);
2625  spivotself(neighsh);
2626  if(neighsh.sh == NULL) break;
2627  if(sdest(neighsh) != sdest(travesh)) sesymself(neighsh);
2628  senext(neighsh, travesh);
2629  }
2630  return sdest(travesh);
2631 }
2632 
2634 // //
2635 // Linear algebra operators. //
2636 // //
2638 
2639 // dot() returns the dot product: v1 dot v2.
2640 inline REAL tetgenmesh::dot(REAL *v1, REAL *v2)
2641 {
2642  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
2643 }
2644 
2645 // cross() computes the cross product: n = v1 cross v2.
2646 inline void tetgenmesh::cross(REAL *v1, REAL *v2, REAL *n)
2647 {
2648  n[0] = v1[1] * v2[2] - v2[1] * v1[2];
2649  n[1] = -(v1[0] * v2[2] - v2[0] * v1[2]);
2650  n[2] = v1[0] * v2[1] - v2[0] * v1[1];
2651 }
2652 
2653 // distance() computes the Euclidean distance between two points.
2655 {
2656  return sqrt((p2[0] - p1[0]) * (p2[0] - p1[0]) +
2657  (p2[1] - p1[1]) * (p2[1] - p1[1]) +
2658  (p2[2] - p1[2]) * (p2[2] - p1[2]));
2659 }
2660 
2662 {
2663  return (x) * (x) + (y) * (y) + (z) * (z);
2664 }
2665 
2666 #endif // tetgenBRH
tetgenmesh::setfacetindex
void setfacetindex(face &f, int value)
Definition: tetgenBR.h:2215
sevent
static selfint_event sevent
Definition: tetgenBR.h:1537
tetgenmesh::numelemattrib
int numelemattrib
Definition: tetgenBR.h:789
tetgenmesh::facemarked
bool facemarked(triface &t)
Definition: tetgenBR.h:1880
tetgenmesh::stbondtbl
static int stbondtbl[12][6]
Definition: tetgenBR.h:847
tetgenmesh::flip22count
long flip22count
Definition: tetgenBR.h:831
tetgenmesh::face::sh
shellface * sh
Definition: tetgenBR.h:402
tetgenmesh::tspivot
void tspivot(triface &t, face &s)
Definition: tetgenBR.h:2258
tetgenmesh::enextself
void enextself(triface &t)
Definition: tetgenBR.h:1624
tetgenmesh::autofliplinklevel
int autofliplinklevel
Definition: tetgenBR.h:805
tetgenbehavior::nonodewritten
int nonodewritten
Definition: tetgenBR.h:83
tetgenmesh::esym
void esym(triface &t1, triface &t2)
Definition: tetgenBR.h:1639
tetgenmesh::pmarktested
bool pmarktested(point pt)
Definition: tetgenBR.h:2474
tetgenmesh::DUPLICATEDVERTEX
@ DUPLICATEDVERTEX
Definition: tetgenBR.h:684
tetgenbehavior::OFF
@ OFF
Definition: tetgenBR.h:147
tetgenmesh::flip26count
long flip26count
Definition: tetgenBR.h:829
tetgenbehavior::facet_overlap_ang_tol
REAL facet_overlap_ang_tol
Definition: tetgenBR.h:117
tetgenmesh::smarktested
bool smarktested(face &s)
Definition: tetgenBR.h:2168
selfint_event::selfint_event
selfint_event()
Definition: tetgenBR.h:1529
tetgenmesh::zmax
REAL zmax
Definition: tetgenBR.h:816
tetgenmesh::cosslidihed
REAL cosslidihed
Definition: tetgenBR.h:811
tetgenmesh::cavesegshlist
arraypool * cavesegshlist
Definition: tetgenBR.h:759
tetgenmesh::shellmark
int shellmark(face &s)
Definition: tetgenBR.h:2121
tetgenmesh::sesym
void sesym(face &s1, face &s2)
Definition: tetgenBR.h:2076
tetgenmesh::incircle3d
REAL incircle3d(point pa, point pb, point pc, point pd)
Definition: tetgenBR.cxx:3138
tetgenmesh::flipconstraints::collectnewtets
int collectnewtets
Definition: tetgenBR.h:597
tetgenbehavior::nobound
int nobound
Definition: tetgenBR.h:82
tetgenbehavior::MESH
@ MESH
Definition: tetgenBR.h:147
tetgenmesh::memorypool::nextitem
void * nextitem
Definition: tetgenBR.h:489
tetgenmesh
Definition: tetgenBR.h:254
tetgenmesh::insertvertexflags::sloc
int sloc
Definition: tetgenBR.h:554
tetgenmesh::enextesym
void enextesym(triface &t1, triface &t2)
Definition: tetgenBR.h:1650
tetgenmesh::flip44count
long flip44count
Definition: tetgenBR.h:830
tetgenmesh::in
tetgenio * in
Definition: tetgenBR.h:734
tetgenmesh::issteinerpoint
bool issteinerpoint(point pt)
Definition: tetgenBR.h:2563
tetgenmesh::shellfacetraverse
shellface * shellfacetraverse(memorypool *)
Definition: tetgenBR.cxx:1419
tetgenmesh::sdecode
void sdecode(shellface sptr, face &s)
Definition: tetgenBR.h:1982
tetgenmesh::projpt2edge
void projpt2edge(REAL *p, REAL *e1, REAL *e2, REAL *prj)
Definition: tetgenBR.cxx:3379
tetgenmesh::memorypool::dealloc
void dealloc(void *)
Definition: tetgenBR.cxx:1147
tetgenbehavior::fixedvolume
int fixedvolume
Definition: tetgenBR.h:65
tetgenmesh::edestoppoself
void edestoppoself(triface &t)
Definition: tetgenBR.h:1694
tetgenmesh::lu_decmp
bool lu_decmp(REAL lu[4][4], int n, int *ps, REAL *d, int N)
Definition: tetgenBR.cxx:3027
tetgenmesh::arraypool::toparraylen
int toparraylen
Definition: tetgenBR.h:439
tetgenmesh::optparameters::min_max_aspectratio
int min_max_aspectratio
Definition: tetgenBR.h:649
tetgenmesh::randomsample
void randomsample(point searchpt, triface *searchtet)
Definition: tetgenBR.cxx:8367
tetgenmesh::interiorangle
REAL interiorangle(REAL *o, REAL *p1, REAL *p2, REAL *n)
Definition: tetgenBR.cxx:3334
tetgenmesh::unmarktest
void unmarktest(triface &t)
Definition: tetgenBR.h:1856
tetgenmesh::cavityexpcount
long cavityexpcount
Definition: tetgenBR.h:828
tetgenmesh::scarveholes
void scarveholes(int, REAL *)
Definition: tetgenBR.cxx:10810
selfint_event::f_marker2
int f_marker2
Definition: tetgenBR.h:1525
tetgenmesh::optparameters::smthiter
int smthiter
Definition: tetgenBR.h:658
tetgenmesh::cosmaxdihed
REAL cosmaxdihed
Definition: tetgenBR.h:809
tetgenmesh::makeindex2pointmap
void makeindex2pointmap(point *&)
Definition: tetgenBR.cxx:1230
tetgenmesh::fsymtbl
static int fsymtbl[12][12]
Definition: tetgenBR.h:841
tetgenmesh::badface::nextitem
badface * nextitem
Definition: tetgenBR.h:532
tetgenmesh::insertvertexflags::chkencflag
int chkencflag
Definition: tetgenBR.h:552
tetgenbehavior::maxvolume
REAL maxvolume
Definition: tetgenBR.h:119
tetgenmesh::incrementalflip
int incrementalflip(point newpt, int, flipconstraints *fc)
Definition: tetgenBR.cxx:8711
tetgenbehavior::nojettison
int nojettison
Definition: tetgenBR.h:87
tetgenmesh::locate
enum locateresult locate(point searchpt, triface *searchtet, int chkencflag=0)
Definition: tetgenBR.cxx:8485
tetgenmesh::SHAREFACE
@ SHAREFACE
Definition: tetgenBR.h:702
tetgenmesh::INSTAR
@ INSTAR
Definition: tetgenBR.h:723
tetgenbehavior::bgmeshfilename
char bgmeshfilename[1024]
Definition: tetgenBR.h:133
tetgenmesh::volumebound
REAL volumebound(tetrahedron *ptr)
Definition: tetgenBR.h:1791
tetgenmesh::minfacetdihed
REAL minfacetdihed
Definition: tetgenBR.h:812
tetgenmesh::sencode
shellface sencode(face &s)
Definition: tetgenBR.h:1988
tetgenmesh::setorg
void setorg(triface &t, point p)
Definition: tetgenBR.h:1750
tetgenmesh::hilbert_split
int hilbert_split(point *vertexarray, int arraysize, int gc0, int gc1, REAL, REAL, REAL, REAL, REAL, REAL)
Definition: tetgenBR.cxx:8144
tetgenmesh::sspivot
void sspivot(face &s, face &edge)
Definition: tetgenBR.h:2328
tetgenmesh::pinfected
bool pinfected(point pt)
Definition: tetgenBR.h:2456
tetgenmesh::flipnm
int flipnm(triface *, int n, int level, int, flipconstraints *fc)
Definition: tetgenBR.cxx:5804
tetgenmesh::cavetetseglist
arraypool * cavetetseglist
Definition: tetgenBR.h:757
tetgenmesh::memorypool::poolinit
void poolinit(int, int, int, int)
Definition: tetgenBR.cxx:1019
tetgenbehavior::object
enum tetgenbehavior::objecttype object
tetgenmesh::transgc
int transgc[8][3][8]
Definition: tetgenBR.h:1239
tetgenmesh::fnextself
void fnextself(triface &t)
tetgenmesh::hilbert_sort3
void hilbert_sort3(point *vertexarray, int arraysize, int e, int d, REAL, REAL, REAL, REAL, REAL, REAL, int depth)
Definition: tetgenBR.cxx:8215
tetgenmesh::flip22
void flip22(face *, int, int)
Definition: tetgenBR.cxx:9281
tetgenmesh::SHAREEDGE
@ SHAREEDGE
Definition: tetgenBR.h:701
tetgenmesh::flip41
void flip41(triface *, int, flipconstraints *fc)
Definition: tetgenBR.cxx:5485
tetgenmesh::tri_edge_test
int tri_edge_test(point, point, point, point, point, point, int, int *, int *)
Definition: tetgenBR.cxx:2853
tetgenmesh::smarktest2ed
bool smarktest2ed(face &s)
Definition: tetgenBR.h:2188
tetgenmesh::edestoppotbl
static int edestoppotbl[12]
Definition: tetgenBR.h:844
selfint_event::int_point
REAL int_point[3]
Definition: tetgenBR.h:1528
tetgenmesh::point2sh
shellface point2sh(point pt)
Definition: tetgenBR.h:2532
c
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
Definition: discreteFrechetDistance.cpp:15
tetgenmesh::orthosphere
bool orthosphere(REAL *, REAL *, REAL *, REAL *, REAL, REAL, REAL, REAL, REAL *, REAL *)
Definition: tetgenBR.cxx:3723
tetgenmesh::points
memorypool * points
Definition: tetgenBR.h:744
tetgenbehavior::nobisect
int nobisect
Definition: tetgenBR.h:57
tetgenmesh::makeshellface
void makeshellface(memorypool *, face *)
Definition: tetgenBR.cxx:1509
tetgenbehavior::convex
int convex
Definition: tetgenBR.h:70
tetgenmesh::badface::fdest
point fdest
Definition: tetgenBR.h:531
tetgenmesh::badface::key
REAL key
Definition: tetgenBR.h:530
tetgenbehavior::VTK
@ VTK
Definition: tetgenBR.h:147
tetgenbehavior::outfilename
char outfilename[1024]
Definition: tetgenBR.h:131
tetgenmesh::incrementaldelaunay
void incrementaldelaunay(clock_t &)
Definition: tetgenBR.cxx:9033
tetgenmesh::recoveredgebyflips
int recoveredgebyflips(point, point, face *, triface *, int fullsearch)
Definition: tetgenBR.cxx:12059
tetgenmesh::tetrahedron
REAL ** tetrahedron
Definition: tetgenBR.h:302
tetgenmesh::flip41count
long flip41count
Definition: tetgenBR.h:830
tetgenmesh::tetrahedrondealloc
void tetrahedrondealloc(tetrahedron *)
Definition: tetgenBR.cxx:1347
tetgenmesh::pointmark
int pointmark(point pt)
Definition: tetgenBR.h:2396
tetgenmesh::unmarktest2
void unmarktest2(triface &t)
Definition: tetgenBR.h:1914
tetgenmesh::randomnation
unsigned long randomnation(unsigned int choices)
Definition: tetgenBR.cxx:8337
tetgenmesh::tssbond1
void tssbond1(triface &t, face &seg)
Definition: tetgenBR.h:2343
tetgenmesh::sorgpivot
static int sorgpivot[6]
Definition: tetgenBR.h:850
tetgenmesh::optimizemesh
void optimizemesh()
Definition: tetgenBR.cxx:17176
tetgenmesh::flipconstraints::chkencflag
int chkencflag
Definition: tetgenBR.h:593
tetgenmesh::hilbert_init
void hilbert_init(int n)
Definition: tetgenBR.cxx:8095
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
tetgenmesh::snextpivot
static int snextpivot[6]
Definition: tetgenBR.h:851
tetgenmesh::triface::triface
triface()
Definition: tetgenBR.h:391
tetgenmesh::freememory
void freememory()
Definition: tetgenBR.h:1429
tetgenmesh::badface
Definition: tetgenBR.h:526
tetgenmesh::subfaces
memorypool * subfaces
Definition: tetgenBR.h:744
tetgenmesh::optparameters::numofsearchdirs
int numofsearchdirs
Definition: tetgenBR.h:655
tetgenmesh::report_selfint_face
int report_selfint_face(point, point, point, face *sface, triface *iedge, int intflag, int *types, int *poss)
Definition: tetgenBR.cxx:4506
tetgenmesh::unifysegments
void unifysegments()
Definition: tetgenBR.cxx:10905
tetgenmesh::decreaseelemcounter
void decreaseelemcounter(triface &t)
Definition: tetgenBR.h:1948
tetgenbehavior::optlevel
int optlevel
Definition: tetgenBR.h:105
tetgenmesh::recoverfacebyflips
int recoverfacebyflips(point, point, point, face *, triface *)
Definition: tetgenBR.cxx:12982
tetgenmesh::face::operator=
face & operator=(const face &s)
Definition: tetgenBR.h:405
tetgenmesh::tri_tri_inter
int tri_tri_inter(point, point, point, point, point, point)
Definition: tetgenBR.cxx:2912
tetgenmesh::arraypool::poolinit
void poolinit(int sizeofobject, int log2objperblk)
Definition: tetgenBR.cxx:779
tetgenbehavior::meditview
int meditview
Definition: tetgenBR.h:80
tetgenmesh::lu_solve
void lu_solve(REAL lu[4][4], int n, int *ps, REAL *b, int N)
Definition: tetgenBR.cxx:3100
tetgenmesh::tetallnormal
void tetallnormal(point, point, point, point, REAL N[4][3], REAL *volume)
Definition: tetgenBR.cxx:3542
tetgenmesh::arraypool::objectsperblock
int objectsperblock
Definition: tetgenBR.h:436
tetgenmesh::calculateabovepoint
bool calculateabovepoint(arraypool *, point *, point *, point *)
Definition: tetgenBR.cxx:3916
tetgenmesh::sinfect
void sinfect(face &s)
Definition: tetgenBR.h:2134
tetgenmesh::flipnm_post
int flipnm_post(triface *, int n, int nn, int, flipconstraints *fc)
Definition: tetgenBR.cxx:6478
tetgenmesh::setpointinsradius
void setpointinsradius(point pt, REAL value)
Definition: tetgenBR.h:2553
tetgenmesh::increaseelemcounter
void increaseelemcounter(triface &t)
Definition: tetgenBR.h:1942
tetgenmesh::calculateabovepoint4
void calculateabovepoint4(point, point, point, point)
Definition: tetgenBR.cxx:4006
tetgenmesh::flipconstraints::bak_tetprism_vol
REAL bak_tetprism_vol
Definition: tetgenBR.h:602
tetgenbehavior::reflevel
int reflevel
Definition: tetgenBR.h:104
tetgenmesh::elemindex
int elemindex(tetrahedron *ptr)
Definition: tetgenBR.h:1804
tetgenmesh::highordertable
point * highordertable
Definition: tetgenBR.h:785
tetgenmesh::badface::ss
face ss
Definition: tetgenBR.h:529
tetgenmesh::sapexpivot
static int sapexpivot[6]
Definition: tetgenBR.h:850
tetgenbehavior::STL
@ STL
Definition: tetgenBR.h:147
tetgenmesh::marktest2
void marktest2(triface &t)
Definition: tetgenBR.h:1909
tetgenmesh::infect
void infect(triface &t)
Definition: tetgenBR.h:1833
REAL
#define REAL
Definition: robustPredicates.cpp:141
tetgenmesh::carveholes
void carveholes()
Definition: tetgenBR.cxx:15267
tetgenmesh::dest
point dest(triface &t)
Definition: tetgenBR.h:1735
tetgenbehavior::epsilon
REAL epsilon
Definition: tetgenBR.h:125
tetgenmesh::memorypool::firstblock
void ** firstblock
Definition: tetgenBR.h:488
tetgenmesh::arraypool::totalmemory
unsigned long totalmemory
Definition: tetgenBR.h:442
tetgenmesh::linelineint
int linelineint(REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *)
Definition: tetgenBR.cxx:3825
tetgenmesh::arraypool::~arraypool
~arraypool()
Definition: tetgenBR.cxx:810
tetgenmesh::flipconstraints::tetprism_vol_sum
REAL tetprism_vol_sum
Definition: tetgenBR.h:603
tetgenmesh::UNKNOWN
@ UNKNOWN
Definition: tetgenBR.h:712
tetgenmesh::caveshlist
arraypool * caveshlist
Definition: tetgenBR.h:759
tetgenmesh::longest
REAL longest
Definition: tetgenBR.h:814
tetgenmesh::outsurfacemesh
void outsurfacemesh(const char *mfilename)
tetgenbehavior::brio_threshold
int brio_threshold
Definition: tetgenBR.h:114
tetgenmesh::decode
void decode(tetrahedron ptr, triface &t)
Definition: tetgenBR.h:1597
tetgenmesh::edge2ver
static int edge2ver[6]
Definition: tetgenBR.h:849
tetgenmesh::badface::forg
point forg
Definition: tetgenBR.h:531
tetgenmesh::stdissolve
void stdissolve(face &s)
Definition: tetgenBR.h:2296
tetgenmesh::marktest
void marktest(triface &t)
Definition: tetgenBR.h:1851
tetgenmesh::puninfect
void puninfect(point pt)
Definition: tetgenBR.h:2451
tetgenmesh::ACROSSFACE
@ ACROSSFACE
Definition: tetgenBR.h:707
tetgenmesh::pointmarkindex
int pointmarkindex
Definition: tetgenBR.h:794
tetgenbehavior::addsteiner_algo
int addsteiner_algo
Definition: tetgenBR.h:98
tetgenmesh::tspivottbl
static int tspivottbl[12][6]
Definition: tetgenBR.h:848
tetgenmesh::badtetrahedrons
memorypool * badtetrahedrons
Definition: tetgenBR.h:748
tetgenmesh::flipconstraints::flipconstraints
flipconstraints()
Definition: tetgenBR.h:614
tetgenmesh::encode
tetrahedron encode(triface &t)
Definition: tetgenBR.h:1584
tetgenmesh::destpivot
static int destpivot[12]
Definition: tetgenBR.h:846
tetgenmesh::badface::noppo
point noppo
Definition: tetgenBR.h:531
tetgenmesh::setpoint2sh
void setpoint2sh(point pt, shellface value)
Definition: tetgenBR.h:2537
tetgenmesh::encode2
tetrahedron encode2(tetrahedron *ptr, int ver)
Definition: tetgenBR.h:1589
tetgenmesh::tetrahedrontraverse
tetrahedron * tetrahedrontraverse()
Definition: tetgenBR.cxx:1370
tetgenmesh::mergefacets
void mergefacets()
Definition: tetgenBR.cxx:11292
tetgenmesh::b
tetgenbehavior * b
Definition: tetgenBR.h:737
tetgenmesh::setdest
void setdest(triface &t, point p)
Definition: tetgenBR.h:1755
tetgenmesh::dissolve
void dissolve(triface &t)
Definition: tetgenBR.h:1614
tetgenmesh::insertvertexflags::refineflag
int refineflag
Definition: tetgenBR.h:557
tetgenmesh::caveshbdlist
arraypool * caveshbdlist
Definition: tetgenBR.h:759
tetgenmesh::st_facref_count
long st_facref_count
Definition: tetgenBR.h:827
tetgenmesh::flipshpush
void flipshpush(face *)
Definition: tetgenBR.cxx:9259
tetgenbehavior::quiet
int quiet
Definition: tetgenBR.h:89
tetgenmesh::encshlist
arraypool * encshlist
Definition: tetgenBR.h:765
tetgenbehavior::MEDIT
@ MEDIT
Definition: tetgenBR.h:147
tetgenmesh::pointtraverse
point pointtraverse()
Definition: tetgenBR.cxx:1453
tetgenbehavior::infilename
char infilename[1024]
Definition: tetgenBR.h:130
tetgenbehavior::neighout
int neighout
Definition: tetgenBR.h:78
tetgenmesh::edestoppo
void edestoppo(triface &t1, triface &t2)
Definition: tetgenBR.h:1688
tetgenmesh::flipconstraints::enqflag
int enqflag
Definition: tetgenBR.h:592
tetgenbehavior::docheck
int docheck
Definition: tetgenBR.h:88
tetgenmesh::sorg
point sorg(face &s)
Definition: tetgenBR.h:2039
tetgenbehavior::vtkview
int vtkview
Definition: tetgenBR.h:81
tetgenmesh::isdeadtet
bool isdeadtet(triface &t)
Definition: tetgenBR.h:1963
tetgenmesh::sdest
point sdest(face &s)
Definition: tetgenBR.h:2044
tetgenmesh::setapex
void setapex(triface &t, point p)
Definition: tetgenBR.h:1760
tetgenmesh::report_overlapping_facets
void report_overlapping_facets(face *, face *, REAL dihedang=0.0)
Definition: tetgenBR.cxx:4042
tetgenmesh::OUTSIDE
@ OUTSIDE
Definition: tetgenBR.h:713
tetgenmesh::st_volref_count
long st_volref_count
Definition: tetgenBR.h:827
tetgenmesh::sapex
point sapex(face &s)
Definition: tetgenBR.h:2049
tetgenmesh::badface::fapex
point fapex
Definition: tetgenBR.h:531
tetgenmesh::totalworkmemory
unsigned long totalworkmemory
Definition: tetgenBR.h:832
tetgenmesh::INTETRAHEDRON
@ INTETRAHEDRON
Definition: tetgenBR.h:714
tetgenmesh::esymself
void esymself(triface &t)
Definition: tetgenBR.h:1645
tetgenbehavior::shellfaceperblock
int shellfaceperblock
Definition: tetgenBR.h:95
tetgenmesh::insertvertexflags::smlen
REAL smlen
Definition: tetgenBR.h:561
tetgenmesh::memorypool::itembytes
int itembytes
Definition: tetgenBR.h:494
tetgenmesh::ENCSUBFACE
@ ENCSUBFACE
Definition: tetgenBR.h:720
tetgenmesh::caveencseglist
arraypool * caveencseglist
Definition: tetgenBR.h:758
tetgenmesh::flip32count
long flip32count
Definition: tetgenBR.h:830
tetgenmesh::eprevtbl
static int eprevtbl[12]
Definition: tetgenBR.h:842
tetgenmesh::tetaspectratio
REAL tetaspectratio(point, point, point, point)
Definition: tetgenBR.cxx:3585
tetgenmesh::orient3dfast
REAL orient3dfast(REAL *pa, REAL *pb, REAL *pc, REAL *pd)
Definition: tetgenBR.cxx:3300
tetgenmesh::optparameters
Definition: tetgenBR.h:645
tetgenmesh::insertvertexflags::splitbdflag
int splitbdflag
Definition: tetgenBR.h:551
tetgenmesh::transfernodes
void transfernodes()
tetgenbehavior::verbose
int verbose
Definition: tetgenBR.h:90
tetgenmesh::interresult
interresult
Definition: tetgenBR.h:697
tetgenmesh::insertpoint
int insertpoint(point, triface *, face *, face *, insertvertexflags *)
Definition: tetgenBR.cxx:6641
tetgenmesh::insertvertexflags::iloc
int iloc
Definition: tetgenBR.h:549
tetgenmesh::suppresssteinerpoints
int suppresssteinerpoints()
Definition: tetgenBR.cxx:14778
tetgenmesh::sscoutsegment
enum interresult sscoutsegment(face *, point, int, int, int)
Definition: tetgenBR.cxx:10587
tetgenbehavior::optminsmtdihed
REAL optminsmtdihed
Definition: tetgenBR.h:123
tetgenmesh::insphere_s
REAL insphere_s(REAL *, REAL *, REAL *, REAL *, REAL *)
Definition: tetgenBR.cxx:1890
tetgenmesh::flipn2ncount
long flipn2ncount
Definition: tetgenBR.h:829
tetgenmesh::apexpivot
static int apexpivot[12]
Definition: tetgenBR.h:846
tetgenmesh::slocate
enum locateresult slocate(point, face *, int, int, int)
Definition: tetgenBR.cxx:10379
tetgenmesh::setpoint2bgmtet
void setpoint2bgmtet(point pt, tetrahedron value)
Definition: tetgenBR.h:2547
tetgenmesh::pmarktest
void pmarktest(point pt)
Definition: tetgenBR.h:2464
tetgenmesh::distance
REAL distance(REAL *p1, REAL *p2)
Definition: tetgenBR.h:2654
tetgenmesh::arraypool
Definition: tetgenBR.h:433
tetgenmesh::~tetgenmesh
~tetgenmesh()
Definition: tetgenBR.h:1495
tetgenmesh::setvolumebound
void setvolumebound(tetrahedron *ptr, REAL value)
Definition: tetgenBR.h:1796
tetgenmesh::setpointmark
void setpointmark(point pt, int value)
Definition: tetgenBR.h:2401
tetgenmesh::flipconstraints::unflip
int unflip
Definition: tetgenBR.h:596
tetgenmesh::suninfect
void suninfect(face &s)
Definition: tetgenBR.h:2140
tetgenmesh::insertvertexflags::validflag
int validflag
Definition: tetgenBR.h:551
tetgenmesh::ssbond1
void ssbond1(face &s, face &edge)
Definition: tetgenBR.h:2316
tetgenmesh::point2ppt
point point2ppt(point pt)
Definition: tetgenBR.h:2522
tetgenbehavior::incrflip
int incrflip
Definition: tetgenBR.h:61
tetgenmesh::insertvertexflags::cdtflag
int cdtflag
Definition: tetgenBR.h:552
tetgenmesh::elemattribute
REAL elemattribute(tetrahedron *ptr, int attnum)
Definition: tetgenBR.h:1778
tetgenmesh::edgemarked
bool edgemarked(triface &t)
Definition: tetgenBR.h:1900
tetgenmesh::setelemattribute
void setelemattribute(tetrahedron *ptr, int attnum, REAL value)
Definition: tetgenBR.h:1783
LegendrePolynomials::fc
void fc(int n, double u, double *val)
Definition: orthogonalBasis.cpp:92
tetgenmesh::setpointtype
void setpointtype(point pt, enum verttype value)
Definition: tetgenBR.h:2413
tetgenmesh::NREGULARVERTEX
@ NREGULARVERTEX
Definition: tetgenBR.h:692
tetgenmesh::arraypool::getblock
char * getblock(int objectindex)
Definition: tetgenBR.cxx:847
tetgenmesh::setshellmark
void setshellmark(face &s, int value)
Definition: tetgenBR.h:2126
tetgenmesh::makepoint
void makepoint(point *, enum verttype)
Definition: tetgenBR.cxx:1549
tetgenmesh::ymax
REAL ymax
Definition: tetgenBR.h:816
tetgenmesh::eprevesymself
void eprevesymself(triface &t)
Definition: tetgenBR.h:1669
tetgenmesh::facepivot1
static int facepivot1[12]
Definition: tetgenBR.h:845
tetgenbehavior::quality
int quality
Definition: tetgenBR.h:56
tetgenmesh::sbond
void sbond(face &s1, face &s2)
Definition: tetgenBR.h:2001
tetgenmesh::DISJOINT
@ DISJOINT
Definition: tetgenBR.h:698
tetgenmesh::facetverticeslist
point * facetverticeslist
Definition: tetgenBR.h:769
tetgenmesh::setsorg
void setsorg(face &s, point pointptr)
Definition: tetgenBR.h:2054
tetgenmesh::enqueuesubface
void enqueuesubface(memorypool *, face *)
Definition: tetgenBR.cxx:15897
tetgenbehavior::POLY
@ POLY
Definition: tetgenBR.h:147
tetgenmesh::marktested
bool marktested(triface &t)
Definition: tetgenBR.h:1861
tetgenmesh::insertvertexflags::rejflag
int rejflag
Definition: tetgenBR.h:552
tetgenbehavior::reversetetori
int reversetetori
Definition: tetgenBR.h:109
selfint_event::f_vertices1
int f_vertices1[3]
Definition: tetgenBR.h:1524
tetgenmesh::tsbond
void tsbond(triface &t, face &s)
Definition: tetgenBR.h:2237
tetgenmesh::sunmarktest3
void sunmarktest3(face &s)
Definition: tetgenBR.h:2201
tetgenmesh::memorypool::pathitem
void * pathitem
Definition: tetgenBR.h:492
tetgenmesh::suppressbdrysteinerpoint
int suppressbdrysteinerpoint(point steinerpt)
Definition: tetgenBR.cxx:14268
tetgenmesh::splitsliver
int splitsliver(triface *, REAL, int)
Definition: tetgenBR.cxx:16920
tetgenmesh::BADELEMENT
@ BADELEMENT
Definition: tetgenBR.h:724
tetgenmesh::recenttet
triface recenttet
Definition: tetgenBR.h:777
terminatetetgen
void terminatetetgen(tetgenmesh *m, int x)
Definition: tetgenBR.h:1539
tetgenmesh::insertvertexflags::lawson
int lawson
Definition: tetgenBR.h:550
tetgenmesh::pmarktest3
void pmarktest3(point pt)
Definition: tetgenBR.h:2494
tetgenmesh::memorypool::pathitemsleft
int pathitemsleft
Definition: tetgenBR.h:498
tetgenbehavior::optscheme
int optscheme
Definition: tetgenBR.h:106
tetgenbehavior::coarsen_percent
REAL coarsen_percent
Definition: tetgenBR.h:126
tetgenmesh::smarktest3
void smarktest3(face &s)
Definition: tetgenBR.h:2195
tetgenbehavior::noelewritten
int noelewritten
Definition: tetgenBR.h:84
tetgenmesh::report_selfint_edge
int report_selfint_edge(point, point, face *sedge, triface *searchtet, enum interresult)
Definition: tetgenBR.cxx:4109
tetgenmesh::infected
bool infected(triface &t)
Definition: tetgenBR.h:1843
tetgenmesh::circumsphere
bool circumsphere(REAL *, REAL *, REAL *, REAL *, REAL *cent, REAL *radius)
Definition: tetgenBR.cxx:3665
tetgenbehavior::nostaticfilter
int nostaticfilter
Definition: tetgenBR.h:74
tetgenbehavior::addinfilename
char addinfilename[1024]
Definition: tetgenBR.h:132
tetgenmesh::pointtype
enum verttype pointtype(point pt)
Definition: tetgenBR.h:2408
tetgenmesh::orgpivot
static int orgpivot[12]
Definition: tetgenBR.h:846
tetgenmesh::pmarktest2
void pmarktest2(point pt)
Definition: tetgenBR.h:2479
tetgenmesh::setelemmarker
void setelemmarker(tetrahedron *ptr, int value)
Definition: tetgenBR.h:1824
tetgenmesh::uninfect
void uninfect(triface &t)
Definition: tetgenBR.h:1838
tetgenmesh::reconstructmesh
bool reconstructmesh(void *)
tetgenmesh::dupverts
long dupverts
Definition: tetgenBR.h:824
tetgenmesh::recoversegments
int recoversegments(arraypool *, int fullsearch, int steinerflag)
Definition: tetgenBR.cxx:12858
tetgenmesh::initializetetgenmesh
void initializetetgenmesh()
Definition: tetgenBR.h:1361
tetgenmesh::setelemindex
void setelemindex(tetrahedron *ptr, int value)
Definition: tetgenBR.h:1810
tetgenmesh::farsorg
point farsorg(face &seg)
Definition: tetgenBR.h:2603
tetgenmesh::tsspivot1
void tsspivot1(triface &t, face &s)
Definition: tetgenBR.h:2371
tetgenbehavior::commandline
char commandline[1024]
Definition: tetgenBR.h:129
tetgenmesh::stpivottbl
static int stpivottbl[12][6]
Definition: tetgenBR.h:848
tetgenmesh::spivotself
void spivotself(face &s)
Definition: tetgenBR.h:2030
tetgenmesh::unmarkedge
void unmarkedge(triface &t)
Definition: tetgenBR.h:1895
tetgenmesh::sesymself
void sesymself(face &s)
Definition: tetgenBR.h:2082
tetgenmesh::DEADVERTEX
@ DEADVERTEX
Definition: tetgenBR.h:693
tetgenmesh::badface::tt
triface tt
Definition: tetgenBR.h:528
tetgenmesh::FREEFACETVERTEX
@ FREEFACETVERTEX
Definition: tetgenBR.h:690
tetgenmesh::tetgenmesh
tetgenmesh()
Definition: tetgenBR.h:1493
tetgenmesh::bgm
tetgenmesh * bgm
Definition: tetgenBR.h:740
tetgenmesh::enqueuetetrahedron
void enqueuetetrahedron(triface *)
Definition: tetgenBR.cxx:15912
tetgenmesh::bondtbl
static int bondtbl[12][12]
Definition: tetgenBR.h:841
tetgenmesh::cavetetlist
arraypool * cavetetlist
Definition: tetgenBR.h:756
tetgenmesh::unflipqueue
arraypool * unflipqueue
Definition: tetgenBR.h:752
tetgenmesh::smarktest
void smarktest(face &s)
Definition: tetgenBR.h:2156
tetgenmesh::arraypool::newindex
int newindex(void **newptr)
Definition: tetgenBR.cxx:949
tetgenmesh::flipconstraints::remove_ndelaunay_edge
int remove_ndelaunay_edge
Definition: tetgenBR.h:601
tetgenmesh::triface::ver
int ver
Definition: tetgenBR.h:390
tetgenmesh::hullsize
long hullsize
Definition: tetgenBR.h:820
tetgenmesh::improvequalitybysmoothing
long improvequalitybysmoothing(optparameters *opm)
Definition: tetgenBR.cxx:16774
tetgenmesh::flip23
void flip23(triface *, int, flipconstraints *fc)
Definition: tetgenBR.cxx:4744
tetgenmesh::pointdealloc
void pointdealloc(point)
Definition: tetgenBR.cxx:1439
tetgenbehavior::tetrahedraperblock
int tetrahedraperblock
Definition: tetgenBR.h:94
tetgenmesh::ssbond
void ssbond(face &s, face &edge)
Definition: tetgenBR.h:2310
tetgenmesh::volumeboundindex
int volumeboundindex
Definition: tetgenBR.h:797
tetgenmesh::facenormal
void facenormal(point pa, point pb, point pc, REAL *n, int pivot, REAL *lav)
Definition: tetgenBR.cxx:3189
tetgenmesh::esymtbl
static int esymtbl[12]
Definition: tetgenBR.h:842
tetgenbehavior::minratio
REAL minratio
Definition: tetgenBR.h:120
tetgenmesh::setsdest
void setsdest(face &s, point pointptr)
Definition: tetgenBR.h:2059
tetgenmesh::initialdelaunay
void initialdelaunay(point pa, point pb, point pc, point pd)
Definition: tetgenBR.cxx:8949
tetgenmesh::flipconstraints::remvert
point remvert
Definition: tetgenBR.h:612
tetgenmesh::senext2self
void senext2self(face &s)
Definition: tetgenBR.h:2101
tetgenmesh::insertvertexflags::assignmeshsize
int assignmeshsize
Definition: tetgenBR.h:553
tetgenmesh::setpointgeomtag
void setpointgeomtag(point pt, int value)
Definition: tetgenBR.h:2426
tetgenmesh::ONFACE
@ ONFACE
Definition: tetgenBR.h:715
tetgenbehavior::insertaddpoints
int insertaddpoints
Definition: tetgenBR.h:68
tetgenmesh::eorgoppo
void eorgoppo(triface &t1, triface &t2)
Definition: tetgenBR.h:1677
tetgenbehavior::PLY
@ PLY
Definition: tetgenBR.h:147
tetgenmesh::removefacebyflips
int removefacebyflips(triface *, flipconstraints *)
Definition: tetgenBR.cxx:11991
tetgenmesh::subfacstack
arraypool * subfacstack
Definition: tetgenBR.h:762
tetgenmesh::arraypool::toparray
char ** toparray
Definition: tetgenBR.h:440
tetgenbehavior::diagnose
int diagnose
Definition: tetgenBR.h:69
tetgenmesh::memorypool::traversalinit
void traversalinit()
Definition: tetgenBR.cxx:1163
tetgenmesh::oppopivot
static int oppopivot[12]
Definition: tetgenBR.h:846
tetgenmesh::optparameters::initval
REAL initval
Definition: tetgenBR.h:653
tetgenmesh::punmarktest2
void punmarktest2(point pt)
Definition: tetgenBR.h:2484
tetgenmesh::identifyinputedges
void identifyinputedges(point *)
Definition: tetgenBR.cxx:11163
tetgenmesh::point2bgmtet
tetrahedron point2bgmtet(point pt)
Definition: tetgenBR.h:2542
tetgenmesh::setelemcounter
void setelemcounter(triface &t, int value)
Definition: tetgenBR.h:1933
tetgenmesh::oppo
point oppo(triface &t)
Definition: tetgenBR.h:1745
tetgenmesh::TOUCHEDGE
@ TOUCHEDGE
Definition: tetgenBR.h:703
tetgenmesh::locateresult
locateresult
Definition: tetgenBR.h:711
tetgenmesh::stpivot
void stpivot(face &s, triface &t)
Definition: tetgenBR.h:2276
tetgenmesh::orient4d_s
REAL orient4d_s(REAL *, REAL *, REAL *, REAL *, REAL *, REAL, REAL, REAL, REAL, REAL)
Definition: tetgenBR.cxx:1961
tetgenbehavior::zeroindex
int zeroindex
Definition: tetgenBR.h:75
tetgenbehavior::vertexperblock
int vertexperblock
Definition: tetgenBR.h:93
selfint_event::f_marker1
int f_marker1
Definition: tetgenBR.h:1522
tetgenbehavior::noexact
int noexact
Definition: tetgenBR.h:73
tetgenmesh::face::face
face()
Definition: tetgenBR.h:404
tetgenmesh::projpt2face
void projpt2face(REAL *p, REAL *f1, REAL *f2, REAL *f3, REAL *prj)
Definition: tetgenBR.cxx:3408
tetgenmesh::marktest2ed
bool marktest2ed(triface &t)
Definition: tetgenBR.h:1919
tetgenmesh::flip31count
long flip31count
Definition: tetgenBR.h:831
tetgenmesh::flippush
void flippush(badface *&, triface *)
Definition: tetgenBR.cxx:8680
tetgenmesh::apex
point apex(triface &t)
Definition: tetgenBR.h:1740
tetgenbehavior::no_sort
int no_sort
Definition: tetgenBR.h:111
tetgenmesh::sstpivot1
void sstpivot1(face &s, triface &t)
Definition: tetgenBR.h:2385
tetgenmesh::pointparamindex
int pointparamindex
Definition: tetgenBR.h:792
tetgenmesh::badsubsegs
memorypool * badsubsegs
Definition: tetgenBR.h:748
tetgenmesh::memorypool::deaditemstack
void * deaditemstack
Definition: tetgenBR.h:490
tetgenmesh::sinsertvertex
int sinsertvertex(point newpt, face *, face *, int iloc, int bowywat, int)
Definition: tetgenBR.cxx:9578
tetgenmesh::sremovevertex
int sremovevertex(point delpt, face *, face *, int lawson)
Definition: tetgenBR.cxx:10079
selfint_event::s_marker1
int s_marker1
Definition: tetgenBR.h:1523
tetgenmesh::unmarkface
void unmarkface(triface &t)
Definition: tetgenBR.h:1875
tetgenmesh::enext
void enext(triface &t1, triface &t2)
Definition: tetgenBR.h:1618
tetgenmesh::bond
void bond(triface &t1, triface &t2)
Definition: tetgenBR.h:1606
tetgenmesh::point
REAL * point
Definition: tetgenBR.h:330
tetgenmesh::memorypool
Definition: tetgenBR.h:486
tetgenmesh::improvequalitybyflips
long improvequalitybyflips()
Definition: tetgenBR.cxx:16425
tetgenbehavior::edgesout
int edgesout
Definition: tetgenBR.h:77
tetgenmesh::ssdissolve
void ssdissolve(face &s)
Definition: tetgenBR.h:2324
tetgenbehavior::refine
int refine
Definition: tetgenBR.h:55
tetgenmesh::memorypool::unallocateditems
int unallocateditems
Definition: tetgenBR.h:497
tetgenmesh::tsbondtbl
static int tsbondtbl[12][6]
Definition: tetgenBR.h:847
tetgenmesh::elemmarker
int elemmarker(tetrahedron *ptr)
Definition: tetgenBR.h:1819
tetgenmesh::sstdissolve1
void sstdissolve1(face &s)
Definition: tetgenBR.h:2366
tetgenmesh::dot
REAL dot(REAL *v1, REAL *v2)
Definition: tetgenBR.h:2640
tetgenmesh::shellfacedealloc
void shellfacedealloc(memorypool *, shellface *)
Definition: tetgenBR.cxx:1404
tetgenmesh::flipconstraints::cosdihed_in
REAL cosdihed_in
Definition: tetgenBR.h:605
tetgenmesh::insegments
long insegments
Definition: tetgenBR.h:819
tetgenmesh::insertvertexflags::sbowywat
int sbowywat
Definition: tetgenBR.h:554
tetgenmesh::ENCVERTEX
@ ENCVERTEX
Definition: tetgenBR.h:718
tetgenmesh::lawsonflip
long lawsonflip()
Definition: tetgenBR.cxx:9496
tetgenmesh::sunmarktest2
void sunmarktest2(face &s)
Definition: tetgenBR.h:2182
tetgenbehavior::flipstarsize
int flipstarsize
Definition: tetgenBR.h:102
tetgenmesh::flipconstraints::checkflipeligibility
int checkflipeligibility
Definition: tetgenBR.h:609
tetgenmesh::triface
Definition: tetgenBR.h:387
tetgenmesh::flipconstraints::seg
point seg[2]
Definition: tetgenBR.h:610
tetgenmesh::areabound
REAL areabound(face &s)
Definition: tetgenBR.h:2108
tetgenbehavior::optminslidihed
REAL optminslidihed
Definition: tetgenBR.h:124
tetgenbehavior::tetgenbehavior
tetgenbehavior()
Definition: tetgenBR.h:160
tetgenmesh::areaboundindex
int areaboundindex
Definition: tetgenBR.h:800
tetgenmesh::checksubfaceflag
int checksubfaceflag
Definition: tetgenBR.h:802
tetgenmesh::shmarkindex
int shmarkindex
Definition: tetgenBR.h:799
tetgenmesh::removevertexbyflips
int removevertexbyflips(point steinerpt)
Definition: tetgenBR.cxx:13745
tetgenmesh::flipconstraints
Definition: tetgenBR.h:589
tetgenmesh::dummypoint
point dummypoint
Definition: tetgenBR.h:775
tetgenmesh::fillregioncount
long fillregioncount
Definition: tetgenBR.h:828
tetgenmesh::senextself
void senextself(face &s)
Definition: tetgenBR.h:2093
tetgenmesh::meshhulledges
long meshhulledges
Definition: tetgenBR.h:822
tetgenbehavior::hilbert_order
int hilbert_order
Definition: tetgenBR.h:112
tetgenmesh::ONVERTEX
@ ONVERTEX
Definition: tetgenBR.h:717
tetgenmesh::removeedgebyflips
int removeedgebyflips(triface *, flipconstraints *)
Definition: tetgenBR.cxx:11898
tetgenmesh::setoppo
void setoppo(triface &t, point p)
Definition: tetgenBR.h:1765
tetgenmesh::inittables
void inittables()
Definition: tetgenBR.cxx:675
tetgenbehavior::delmaxfliplevel
int delmaxfliplevel
Definition: tetgenBR.h:107
tetgenmesh::initializepools
void initializepools()
Definition: tetgenBR.cxx:1591
tetgenmesh::RIDGEVERTEX
@ RIDGEVERTEX
Definition: tetgenBR.h:685
tetgenmesh::subsegs
memorypool * subsegs
Definition: tetgenBR.h:744
tetgenmesh::badface::cent
REAL cent[6]
Definition: tetgenBR.h:530
tetgenmesh::tri_edge_inter_tail
int tri_edge_inter_tail(point, point, point, point, point, REAL, REAL)
Definition: tetgenBR.cxx:2875
tetgenmesh::SHAREVERT
@ SHAREVERT
Definition: tetgenBR.h:700
tetgenmesh::ACROSSVERT
@ ACROSSVERT
Definition: tetgenBR.h:705
tetgenmesh::pointmtrindex
int pointmtrindex
Definition: tetgenBR.h:791
tetgenmesh::tet2subpool
memorypool * tet2subpool
Definition: tetgenBR.h:745
tetgenmesh::memorypool::maxitems
long maxitems
Definition: tetgenBR.h:496
tetgenbehavior::metric
int metric
Definition: tetgenBR.h:63
tetgenbehavior::facet_small_ang_tol
REAL facet_small_ang_tol
Definition: tetgenBR.h:118
tetgenmesh::enexttbl
static int enexttbl[12]
Definition: tetgenBR.h:842
tetgenmesh::sinfected
bool sinfected(face &s)
Definition: tetgenBR.h:2148
tetgenbehavior::plc
int plc
Definition: tetgenBR.h:53
tetgenmesh::recoverdelaunay
void recoverdelaunay()
Definition: tetgenBR.cxx:16219
tetgenmesh::setpointgeomuv
void setpointgeomuv(point pt, int i, REAL value)
Definition: tetgenBR.h:2438
tetgenmesh::arraypool::log2objectsperblock
int log2objectsperblock
Definition: tetgenBR.h:437
tetgenmesh::elemattribindex
int elemattribindex
Definition: tetgenBR.h:796
tetgenmesh::sdissolve
void sdissolve(face &s)
Definition: tetgenBR.h:2019
tetgenmesh::memorypool::restart
void restart()
Definition: tetgenBR.cxx:1063
selfint_event::e_type
int e_type
Definition: tetgenBR.h:1521
tetgenmesh::sdestpivot
static int sdestpivot[6]
Definition: tetgenBR.h:850
tetgenmesh::norm2
REAL norm2(REAL x, REAL y, REAL z)
Definition: tetgenBR.h:2661
tetgenmesh::tsdissolve
void tsdissolve(triface &t)
Definition: tetgenBR.h:2289
selfint_event::s_marker2
int s_marker2
Definition: tetgenBR.h:1526
tetgenmesh::add_steinerpt_in_segment
int add_steinerpt_in_segment(face *, int searchlevel)
Definition: tetgenBR.cxx:12498
tetgenmesh::fnext
void fnext(triface &t1, triface &t2)
Definition: tetgenBR.h:1716
tetgenmesh::flipconstraints::remove_large_angle
int remove_large_angle
Definition: tetgenBR.h:604
tetgenmesh::tet2segpool
memorypool * tet2segpool
Definition: tetgenBR.h:745
tetgenmesh::FREEVOLVERTEX
@ FREEVOLVERTEX
Definition: tetgenBR.h:691
tetgenbehavior::supsteiner_level
int supsteiner_level
Definition: tetgenBR.h:97
tetgenmesh::ACROSSEDGE
@ ACROSSEDGE
Definition: tetgenBR.h:706
tetgenmesh::checkconstraints
int checkconstraints
Definition: tetgenBR.h:803
tetgenmesh::pmarktest3ed
bool pmarktest3ed(point pt)
Definition: tetgenBR.h:2504
tetgenmesh::markface
void markface(triface &t)
Definition: tetgenBR.h:1870
tetgenmesh::triface::tet
tetrahedron * tet
Definition: tetgenBR.h:389
point
Definition: shapeFunctions.h:305
tetgenmesh::point2tetorg
void point2tetorg(point pt, triface &t)
Definition: tetgenBR.h:2571
selfint_event::f_vertices2
int f_vertices2[3]
Definition: tetgenBR.h:1527
tetgenmesh::senext
void senext(face &s1, face &s2)
Definition: tetgenBR.h:2087
tetgenmesh::recoversubfaces
int recoversubfaces(arraypool *, int steinerflag)
Definition: tetgenBR.cxx:13146
tetgenmesh::flip32
void flip32(triface *, int, flipconstraints *fc)
Definition: tetgenBR.cxx:5083
tetgenbehavior::voroout
int voroout
Definition: tetgenBR.h:79
tetgenmesh::eprevesymtbl
static int eprevesymtbl[12]
Definition: tetgenBR.h:843
tetgenmesh::finddirection
enum interresult finddirection(triface *searchtet, point endpt)
Definition: tetgenBR.cxx:11457
tetgenmesh::arraypool::objectbytes
int objectbytes
Definition: tetgenBR.h:435
tetgenmesh::zmin
REAL zmin
Definition: tetgenBR.h:816
tetgenmesh::cossmtdihed
REAL cossmtdihed
Definition: tetgenBR.h:810
tetgenmesh::VOLVERTEX
@ VOLVERTEX
Definition: tetgenBR.h:688
tetgenmesh::fsym
void fsym(triface &t1, triface &t2)
Definition: tetgenBR.h:1701
tetgenbehavior::parse_commandline
bool parse_commandline(char *switches)
Definition: tetgenBR.h:154
tetgenmesh::arraypool::restart
void restart()
Definition: tetgenBR.cxx:765
tetgenmesh::removeslivers
long removeslivers(int)
Definition: tetgenBR.cxx:17052
tetgenbehavior::noiterationnum
int noiterationnum
Definition: tetgenBR.h:86
tetgenmesh::pointgeomtag
int pointgeomtag(point pt)
Definition: tetgenBR.h:2421
tetgenbehavior::NODES
@ NODES
Definition: tetgenBR.h:147
tetgenmesh::facepivot2
static int facepivot2[12][12]
Definition: tetgenBR.h:845
tetgenmesh::optparameters::min_max_dihedangle
int min_max_dihedangle
Definition: tetgenBR.h:650
tetgenmesh::getedge
int getedge(point, point, triface *)
Definition: tetgenBR.cxx:13540
tetgenmesh::getvertexstar
int getvertexstar(int, point searchpt, arraypool *, arraypool *, arraypool *)
Definition: tetgenBR.cxx:13398
tetgenbehavior::regionattrib
int regionattrib
Definition: tetgenBR.h:66
tetgenbehavior::order
int order
Definition: tetgenBR.h:108
tetgenbehavior::usage
void usage()
tetgenmesh::punmarktest3
void punmarktest3(point pt)
Definition: tetgenBR.h:2499
tetgenmesh::sbond1
void sbond1(face &s1, face &s2)
Definition: tetgenBR.h:2011
tetgenmesh::FACETVERTEX
@ FACETVERTEX
Definition: tetgenBR.h:687
tetgenbehavior::optmaxdihedral
REAL optmaxdihedral
Definition: tetgenBR.h:122
tetgenmesh::unuverts
long unuverts
Definition: tetgenBR.h:825
tetgenmesh::nonregularcount
long nonregularcount
Definition: tetgenBR.h:826
tetgenmesh::PI
static REAL PI
Definition: tetgenBR.h:781
tetgenmesh::badsubfacs
memorypool * badsubfacs
Definition: tetgenBR.h:748
tetgenmesh::eprevself
void eprevself(triface &t)
Definition: tetgenBR.h:1634
tetgenmesh::tetprism_vol_sum
REAL tetprism_vol_sum
Definition: tetgenBR.h:813
tetgenmesh::sunmarktest
void sunmarktest(face &s)
Definition: tetgenBR.h:2162
tetgenbehavior::facesout
int facesout
Definition: tetgenBR.h:76
tetgenmesh::eorgoppoself
void eorgoppoself(triface &t)
Definition: tetgenBR.h:1683
tetgenmesh::NEARVERTEX
@ NEARVERTEX
Definition: tetgenBR.h:721
tetgenmesh::xmax
REAL xmax
Definition: tetgenBR.h:816
tetgenmesh::badface::foppo
point foppo
Definition: tetgenBR.h:531
tetgenmesh::arraypool::objectsperblockmark
int objectsperblockmark
Definition: tetgenBR.h:438
tetgenmesh::insertvertexflags::bowywat
int bowywat
Definition: tetgenBR.h:550
tetgenmesh::senext2
void senext2(face &s1, face &s2)
Definition: tetgenBR.h:2095
tetgenmesh::outmesh2medit
void outmesh2medit(const char *mfilename)
z
const double z
Definition: GaussQuadratureQuad.cpp:56
tetgenmesh::sizeoftensor
int sizeoftensor
Definition: tetgenBR.h:790
tetgenmesh::addsteiner4recoversegment
int addsteiner4recoversegment(face *, int)
Definition: tetgenBR.cxx:12669
tetgenmesh::reduceedgesatvertex
int reduceedgesatvertex(point startpt, arraypool *endptlist)
Definition: tetgenBR.cxx:13658
tetgenmesh::tssdissolve1
void tssdissolve1(triface &t)
Definition: tetgenBR.h:2359
tetgenmesh::xmin
REAL xmin
Definition: tetgenBR.h:816
tetgenmesh::insertvertexflags::respectbdflag
int respectbdflag
Definition: tetgenBR.h:551
tetgenmesh::badface::badface
badface()
Definition: tetgenBR.h:533
tetgenmesh::getpointinsradius
REAL getpointinsradius(point pt)
Definition: tetgenBR.h:2558
tetgenmesh::UNUSEDVERTEX
@ UNUSEDVERTEX
Definition: tetgenBR.h:683
tetgenmesh::arraypool::lookup
void * lookup(int objectindex)
Definition: tetgenBR.cxx:912
tetgenbehavior::nobisect_nomerge
int nobisect_nomerge
Definition: tetgenBR.h:96
tetgenmesh::memorypool::pathblock
void ** pathblock
Definition: tetgenBR.h:491
tetgenbehavior::weighted_param
int weighted_param
Definition: tetgenBR.h:100
tetgenmesh::minfaceang
REAL minfaceang
Definition: tetgenBR.h:812
tetgenmesh::flipconstraints::collectencsegflag
int collectencsegflag
Definition: tetgenBR.h:598
tetgenmesh::getfacetindex
int getfacetindex(face &f)
Definition: tetgenBR.h:2220
selfint_event
Definition: tetgenBR.h:1519
tetgenmesh::nonconvex
int nonconvex
Definition: tetgenBR.h:804
tetgenmesh::encseglist
arraypool * encseglist
Definition: tetgenBR.h:765
tetgenbehavior::steinerleft
int steinerleft
Definition: tetgenBR.h:110
tetgenmesh::pinfect
void pinfect(point pt)
Definition: tetgenBR.h:2446
tetgenmesh::memorypool::itemwords
int itemwords
Definition: tetgenBR.h:494
tetgenbehavior::nomergevertex
int nomergevertex
Definition: tetgenBR.h:72
tetrahedron
Definition: shapeFunctions.h:682
tetgenmesh::ENCSEGMENT
@ ENCSEGMENT
Definition: tetgenBR.h:719
tetgenmesh::subvertstack
arraypool * subvertstack
Definition: tetgenBR.h:762
tetgenmesh::memorypool::nowblock
void ** nowblock
Definition: tetgenBR.h:488
tetgenbehavior::brio_hilbert
int brio_hilbert
Definition: tetgenBR.h:60
tetgenmesh::flipconstraints::fac
point fac[3]
Definition: tetgenBR.h:611
tetgenmesh::punmarktest
void punmarktest(point pt)
Definition: tetgenBR.h:2469
tetgenmesh::epivot
static int epivot[12]
Definition: tetgenBR.h:849
tetgenmesh::flipconstraints::cosdihed_out
REAL cosdihed_out
Definition: tetgenBR.h:606
tetgenmesh::eorgoppotbl
static int eorgoppotbl[12]
Definition: tetgenBR.h:844
tetgenmesh::randomseed
unsigned long randomseed
Definition: tetgenBR.h:808
tetgenmesh::add_steinerpt_in_schoenhardtpoly
int add_steinerpt_in_schoenhardtpoly(triface *, int, int chkencflag)
Definition: tetgenBR.cxx:12343
tetgenmesh::setareabound
void setareabound(face &s, REAL value)
Definition: tetgenBR.h:2113
tetgenmesh::caveencshlist
arraypool * caveencshlist
Definition: tetgenBR.h:758
tetgenmesh::point2shorg
void point2shorg(point pa, face &s)
Definition: tetgenBR.h:2588
tetgenmesh::elemmarkerindex
int elemmarkerindex
Definition: tetgenBR.h:798
tetgenmesh::verttype
verttype
Definition: tetgenBR.h:682
tetgenbehavior::parse_commandline
bool parse_commandline(int argc, char **argv)
Definition: tetgenBR.cxx:41
tetgenmesh::cosmindihed
REAL cosmindihed
Definition: tetgenBR.h:809
tetgenmesh::steinerleft
long steinerleft
Definition: tetgenBR.h:823
tetgenmesh::subsegstack
arraypool * subsegstack
Definition: tetgenBR.h:762
tetgenmesh::jettisonnodes
void jettisonnodes()
Definition: tetgenBR.cxx:17331
tetgenmesh::enextesymself
void enextesymself(triface &t)
Definition: tetgenBR.h:1656
tetgenmesh::memorypool::alloc
void * alloc()
Definition: tetgenBR.cxx:1090
tetgenmesh::setsapex
void setsapex(face &s, point pointptr)
Definition: tetgenBR.h:2064
tetgenmesh::ONEDGE
@ ONEDGE
Definition: tetgenBR.h:716
tetgenmesh::sencode2
shellface sencode2(shellface *sh, int shver)
Definition: tetgenBR.h:1993
tetgenmesh::tsb1mod3
int tsb1mod3[8]
Definition: tetgenBR.h:1239
tetgenmesh::pointgeomuv
REAL pointgeomuv(point pt, int i)
Definition: tetgenBR.h:2433
tetgenmesh::point2tet
tetrahedron point2tet(point pt)
Definition: tetgenBR.h:2512
tetgenmesh::cavetetshlist
arraypool * cavetetshlist
Definition: tetgenBR.h:757
tetgenmesh::optparameters::imprval
REAL imprval
Definition: tetgenBR.h:653
tetgenmesh::triarea
REAL triarea(REAL *pa, REAL *pb, REAL *pc)
Definition: tetgenBR.cxx:3283
tetgenmesh::memorypool::items
long items
Definition: tetgenBR.h:496
tetgenbehavior::varvolume
int varvolume
Definition: tetgenBR.h:64
tetgenmesh::enextesymtbl
static int enextesymtbl[12]
Definition: tetgenBR.h:843
tetgenbehavior::coarsen_param
int coarsen_param
Definition: tetgenBR.h:99
tetgenmesh::triface::operator=
triface & operator=(const triface &t)
Definition: tetgenBR.h:392
tetgenmesh::flippool
memorypool * flippool
Definition: tetgenBR.h:751
tetgenmesh::setpoint2ppt
void setpoint2ppt(point pt, point value)
Definition: tetgenBR.h:2527
tetgenmesh::shortdistance
REAL shortdistance(REAL *p, REAL *e1, REAL *e2)
Definition: tetgenBR.cxx:3255
tetgenmesh::tri_edge_tail
int tri_edge_tail(point, point, point, point, point, point, REAL, REAL, int, int *, int *)
Definition: tetgenBR.cxx:2655
tetgenmesh::optparameters::optparameters
optparameters()
Definition: tetgenBR.h:660
tetgenmesh::fsymself
void fsymself(triface &t)
tetgenmesh::optparameters::searchstep
REAL searchstep
Definition: tetgenBR.h:656
tetgenmesh::markedge
void markedge(triface &t)
Definition: tetgenBR.h:1890
tetgenmesh::memorypool::~memorypool
~memorypool()
Definition: tetgenBR.cxx:994
tetgenmesh::setpoint2tet
void setpoint2tet(point pt, tetrahedron value)
Definition: tetgenBR.h:2517
tetgenmesh::memorypool::itemsperblock
int itemsperblock
Definition: tetgenBR.h:495
tetgenmesh::addin
tetgenio * addin
Definition: tetgenBR.h:734
tetgenbehavior::syntax
void syntax()
tetgenbehavior::mindihedral
REAL mindihedral
Definition: tetgenBR.h:121
tetgenmesh::ishulltet
bool ishulltet(triface &t)
Definition: tetgenBR.h:1956
tetgenmesh::flip14count
long flip14count
Definition: tetgenBR.h:829
tetgenmesh::flip23count
long flip23count
Definition: tetgenBR.h:830
tetgenmesh::samples
long samples
Definition: tetgenBR.h:807
tetgenbehavior::nomergefacet
int nomergefacet
Definition: tetgenBR.h:71
tetgenmesh::point2simindex
int point2simindex
Definition: tetgenBR.h:793
tetgenmesh::cavetetvertlist
arraypool * cavetetvertlist
Definition: tetgenBR.h:757
tetgenbehavior
Definition: tetgenBR.h:50
tetgenbehavior::flipinsert
int flipinsert
Definition: tetgenBR.h:62
tetgenbehavior::fliplinklevel
int fliplinklevel
Definition: tetgenBR.h:101
tetgenmesh::tetprismvol
REAL tetprismvol(REAL *pa, REAL *pb, REAL *pc, REAL *pd)
Definition: tetgenBR.cxx:3884
tetgenmesh::cross
void cross(REAL *v1, REAL *v2, REAL *n)
Definition: tetgenBR.h:2646
tetgenmesh::optparameters::max_min_volume
int max_min_volume
Definition: tetgenBR.h:648
tetgenmesh::tri_edge_2d
int tri_edge_2d(point, point, point, point, point, point, int, int *, int *)
Definition: tetgenBR.cxx:2044
tetgenbehavior::objecttype
objecttype
Definition: tetgenBR.h:147
tetgenbehavior::brio_ratio
REAL brio_ratio
Definition: tetgenBR.h:115
tetgenmesh::pmarktest2ed
bool pmarktest2ed(point pt)
Definition: tetgenBR.h:2489
tetgenmesh::TOUCHFACE
@ TOUCHFACE
Definition: tetgenBR.h:704
tetgenmesh::arraypool::arraypool
arraypool(int sizeofobject, int log2objperblk)
Definition: tetgenBR.cxx:805
tetgenmesh::ymin
REAL ymin
Definition: tetgenBR.h:816
tetgenmesh::insertvertexflags::refinetet
triface refinetet
Definition: tetgenBR.h:558
tetgenmesh::NONREGULAR
@ NONREGULAR
Definition: tetgenBR.h:722
tetgenmesh::numpointattrib
int numpointattrib
Definition: tetgenBR.h:788
tetgenmesh::tetalldihedral
bool tetalldihedral(point, point, point, point, REAL *, REAL *, REAL *)
Definition: tetgenBR.cxx:3444
tetgenbehavior::cdtrefine
int cdtrefine
Definition: tetgenBR.h:67
tetgenmesh::memorypool::memorypool
memorypool()
Definition: tetgenBR.cxx:967
tetgenmesh::insertvertexflags::smlenflag
int smlenflag
Definition: tetgenBR.h:560
tetgenmesh::INTERSECT
@ INTERSECT
Definition: tetgenBR.h:699
tetgenmesh::checksubsegflag
int checksubsegflag
Definition: tetgenBR.h:801
tetgenmesh::lawsonflip3d
long lawsonflip3d(flipconstraints *fc)
Definition: tetgenBR.cxx:15931
tetgenmesh::useinsertradius
int useinsertradius
Definition: tetgenBR.h:806
tetgenmesh::cavitycount
long cavitycount
Definition: tetgenBR.h:828
tetgenmesh::arraypool::objects
long objects
Definition: tetgenBR.h:441
tetgenmesh::smarktest3ed
bool smarktest3ed(face &s)
Definition: tetgenBR.h:2207
tetgenmesh::insertvertexflags
Definition: tetgenBR.h:547
tetgenmesh::meshedges
long meshedges
Definition: tetgenBR.h:821
tetgenmesh::tetrahedrons
memorypool * tetrahedrons
Definition: tetgenBR.h:744
tetgenmesh::eprev
void eprev(triface &t1, triface &t2)
Definition: tetgenBR.h:1628
tetgenmesh::recoverboundary
void recoverboundary(clock_t &)
Definition: tetgenBR.cxx:14934
tetgenmesh::cavebdrylist
arraypool * cavebdrylist
Definition: tetgenBR.h:756
tetgenbehavior::fliplinklevelinc
int fliplinklevelinc
Definition: tetgenBR.h:103
tetgenmesh::ver2edge
static int ver2edge[12]
Definition: tetgenBR.h:849
tetgenmesh::insertvertexflags::parentpt
point parentpt
Definition: tetgenBR.h:562
tetgenmesh::ACUTEVERTEX
@ ACUTEVERTEX
Definition: tetgenBR.h:686
tetgenbehavior::hilbert_limit
int hilbert_limit
Definition: tetgenBR.h:113
tetgenmesh::memorypool::traverse
void * traverse()
Definition: tetgenBR.cxx:1191
tetgenmesh::brio_multiscale_sort
void brio_multiscale_sort(point *, int, int threshold, REAL ratio, int *depth)
Definition: tetgenBR.cxx:8315
tetgenmesh::insertvertexflags::insertvertexflags
insertvertexflags()
Definition: tetgenBR.h:564
tetgenmesh::minedgelength
REAL minedgelength
Definition: tetgenBR.h:815
tetgenbehavior::psc
int psc
Definition: tetgenBR.h:54
tetgenbehavior::facet_separate_ang_tol
REAL facet_separate_ang_tol
Definition: tetgenBR.h:116
tetgenmesh::optparameters::maxiter
int maxiter
Definition: tetgenBR.h:657
tetgenbehavior::coarsen
int coarsen
Definition: tetgenBR.h:58
tetgenmesh::segmentendpointslist
point * segmentendpointslist
Definition: tetgenBR.h:772
tetgenmesh::elemcounter
int elemcounter(triface &t)
Definition: tetgenBR.h:1928
tetgenmesh::makepoint2submap
void makepoint2submap(memorypool *, int *&, face *&)
Definition: tetgenBR.cxx:1264
tetgenmesh::face::shver
int shver
Definition: tetgenBR.h:403
tetgenmesh::sstbond1
void sstbond1(face &s, triface &t)
Definition: tetgenBR.h:2354
tetgenmesh::smoothpoint
int smoothpoint(point smtpt, arraypool *, int ccw, optparameters *opm)
Definition: tetgenBR.cxx:16615
tetgenbehavior::weighted
int weighted
Definition: tetgenBR.h:59
tetgenmesh::alltetrahedrontraverse
tetrahedron * alltetrahedrontraverse()
Definition: tetgenBR.cxx:1384
tetgenmesh::flipstack
badface * flipstack
Definition: tetgenBR.h:753
tetgenmesh::caveoldtetlist
arraypool * caveoldtetlist
Definition: tetgenBR.h:756
tetgenmesh::org
point org(triface &t)
Definition: tetgenBR.h:1730
tetgenbehavior::nofacewritten
int nofacewritten
Definition: tetgenBR.h:85
tetgenmesh::smarktest2
void smarktest2(face &s)
Definition: tetgenBR.h:2176
tetgenmesh::insertvertexflags::refinesh
face refinesh
Definition: tetgenBR.h:559
tetgenmesh::farsdest
point farsdest(face &seg)
Definition: tetgenBR.h:2618
tetgenmesh::spivot
void spivot(face &s1, face &s2)
Definition: tetgenBR.h:2024
tetgenmesh::eprevesym
void eprevesym(triface &t1, triface &t2)
Definition: tetgenBR.h:1663
tetgenmesh::gettetrahedron
int gettetrahedron(point, point, point, point, triface *)
Definition: tetgenBR.cxx:16388
tetgenmesh::maketetrahedron
void maketetrahedron(triface *)
Definition: tetgenBR.cxx:1472
tetgenmesh::planelineint
void planelineint(REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *)
Definition: tetgenBR.cxx:3790
tetgenmesh::insertpoint_abort
void insertpoint_abort(face *, insertvertexflags *)
Definition: tetgenBR.cxx:8037
tetgenmesh::recentsh
face recentsh
Definition: tetgenBR.h:778
tetgenmesh::FREESEGVERTEX
@ FREESEGVERTEX
Definition: tetgenBR.h:689
tetgenmesh::pointinsradiusindex
int pointinsradiusindex
Definition: tetgenBR.h:795
tetgenmesh::flip31
void flip31(face *, int)
Definition: tetgenBR.cxx:9403
tetgenmesh::idx2facetlist
int * idx2facetlist
Definition: tetgenBR.h:768
tetgenmesh::shellface
REAL ** shellface
Definition: tetgenBR.h:313
tetgenmesh::checkflipeligibility
int checkflipeligibility(int fliptype, point, point, point, point, point, int level, int edgepivot, flipconstraints *fc)
Definition: tetgenBR.cxx:11663
tetgenmesh::face
Definition: tetgenBR.h:400
tetgenmesh::memorypool::alignbytes
int alignbytes
Definition: tetgenBR.h:493
tetgenmesh::st_segref_count
long st_segref_count
Definition: tetgenBR.h:827