931 typedef REAL **tetrahedron;
942 typedef REAL **shellface;
1016 tet = t.tet; ver = t.ver;
1025 face() : sh(0), shver(0) {}
1027 sh = s.sh; shver = s.shver;
1055 int objectsperblock;
1056 int log2objectsperblock;
1057 int objectsperblockmark;
1061 unsigned long totalmemory;
1064 void poolinit(
int sizeofobject,
int log2objperblk);
1065 char* getblock(
int objectindex);
1066 void* lookup(
int objectindex);
1067 int newindex(
void **newptr);
1069 arraypool(
int sizeofobject,
int log2objperblk);
1077#define fastlookup(pool, index) \
1078 (void *) ((pool)->toparray[(index) >> (pool)->log2objectsperblock] + \
1079 ((index) & (pool)->objectsperblockmark) * (pool)->objectbytes)
1106 void **firstblock, **nowblock;
1108 void *deaditemstack;
1112 int itembytes, itemwords;
1114 long items, maxitems;
1115 int unallocateditems;
1122 void poolinit(
int,
int,
int,
int);
1125 void dealloc(
void*);
1126 void traversalinit();
1149 point forg, fdest, fapex, foppo, noppo;
1151 badface() : key(0), forg(0), fdest(0), fapex(0), foppo(0), noppo(0),
1155 for (
int k = 0; k < 6; k++) cent[k] = 0.;
1156 tt.tet = NULL; tt.ver = 0;
1157 ss.sh = NULL; ss.shver = 0;
1158 forg = fdest = fapex = foppo = noppo = NULL;
1176 int bowywat, lawson;
1177 int splitbdflag, validflag, respectbdflag;
1178 int rejflag, chkencflag, cdtflag;
1183 int collect_inial_cavity_flag;
1184 int ignore_near_vertex;
1185 int check_insert_radius;
1194 iloc = bowywat = lawson = 0;
1195 splitbdflag = validflag = respectbdflag = 0;
1196 rejflag = chkencflag = cdtflag = 0;
1198 sloc = sbowywat = 0;
1200 collect_inial_cavity_flag = 0;
1201 ignore_near_vertex = 0;
1202 check_insert_radius = 0;
1204 refinetet.tet = NULL;
1236 int collectencsegflag;
1239 int noflip_in_surface;
1240 int remove_ndelaunay_edge;
1241 REAL bak_tetprism_vol;
1242 REAL tetprism_vol_sum;
1243 int remove_large_angle;
1249 int checkflipeligibility;
1261 collectencsegflag = 0;
1263 noflip_in_surface = 0;
1264 remove_ndelaunay_edge = 0;
1265 bak_tetprism_vol = 0.0;
1266 tetprism_vol_sum = 0.0;
1267 remove_large_angle = 0;
1272 checkflipeligibility = 0;
1293 int min_max_aspectratio;
1294 int min_max_dihedangle;
1297 REAL initval, imprval;
1299 int numofsearchdirs;
1307 min_max_aspectratio = 0;
1308 min_max_dihedangle = 0;
1310 initval = imprval = 0.0;
1312 numofsearchdirs = 10;
1328 enum verttype {UNUSEDVERTEX, DUPLICATEDVERTEX, RIDGEVERTEX,
1329 FACETVERTEX, VOLVERTEX, FREESEGVERTEX, FREEFACETVERTEX,
1330 FREEVOLVERTEX, NREGULARVERTEX, DEADVERTEX};
1333 enum interresult {DISJOINT, INTERSECT, SHAREVERT, SHAREEDGE, SHAREFACE,
1334 TOUCHEDGE, TOUCHFACE, ACROSSVERT, ACROSSEDGE, ACROSSFACE,
1338 enum locateresult {UNKNOWN, OUTSIDE, INTETRAHEDRON, ONFACE, ONEDGE, ONVERTEX,
1339 ENCVERTEX, ENCSEGMENT, ENCSUBFACE, NEARVERTEX, NONREGULAR,
1340 INSTAR, BADELEMENT, NULLCAVITY, SHARPCORNER, FENSEDIN,
1341 NONCOPLANAR, SELF_ENCROACH};
1360 memorypool *tetrahedrons, *subfaces, *subsegs, *points;
1361 memorypool *tet2subpool, *tet2segpool;
1364 memorypool *badtetrahedrons, *badsubfacs, *badsubsegs;
1365 memorypool *split_subfaces_pool, *split_segments_pool;
1366 arraypool *unsplit_badtets, *unsplit_subfaces, *unsplit_segments;
1367 arraypool *check_tets_list;
1369 badface *stack_enc_segments, *stack_enc_subfaces;
1372 badface *queuefront[64];
1373 badface *queuetail[64];
1374 int nextnonemptyq[64];
1375 int firstnonemptyq, recentq;
1378 memorypool *badqual_tets_pool;
1379 badface *bt_queuefront[64];
1380 badface *bt_queuetail[64];
1381 int bt_nextnonemptyq[64];
1382 int bt_firstnonemptyq, bt_recentq;
1385 memorypool *flippool;
1386 arraypool *later_unflip_queue, *unflipqueue;
1387 badface *flipstack, *unflip_queue_front, *unflip_queue_tail;
1390 arraypool *cavetetlist, *cavebdrylist, *caveoldtetlist;
1391 arraypool *cave_oldtet_list;
1392 arraypool *cavetetshlist, *cavetetseglist, *cavetetvertlist;
1393 arraypool *caveencshlist, *caveencseglist;
1394 arraypool *caveshlist, *caveshbdlist, *cavesegshlist;
1395 triface _bw_faces[4096];
1398 arraypool *subsegstack, *subfacstack, *subvertstack;
1399 arraypool *skipped_segment_list, *skipped_facet_list;
1402 arraypool *encseglist, *encshlist;
1405 int number_of_facets;
1407 point *facetverticeslist;
1408 int *idx_segment_facet_list;
1409 int *segment_facet_list;
1410 int *idx_ridge_vertex_facet_list;
1411 int *ridge_vertex_facet_list;
1414 int segmentendpointslist_length;
1415 point *segmentendpointslist;
1416 double *segment_info_list;
1417 int *idx_segment_ridge_vertex_list;
1418 point *segment_ridge_vertex_list;
1431 int *subdomain_markers;
1438 int pointparamindex;
1441 int pointinsradiusindex;
1442 int elemattribindex;
1444 int volumeboundindex;
1445 int elemmarkerindex;
1448 int checksubsegflag;
1449 int checksubfaceflag;
1450 int boundary_recovery_flag;
1451 int checkconstraints;
1453 int autofliplinklevel;
1454 int useinsertradius;
1456 unsigned long randomseed;
1457 REAL cosmaxdihed, cosmindihed;
1460 REAL cos_large_dihed;
1461 REAL opt_max_sliver_asp_ratio;
1462 REAL minfaceang, minfacetdihed;
1463 REAL cos_facet_separate_ang_tol;
1464 REAL cos_collinear_ang_tol;
1465 REAL tetprism_vol_sum;
1468 REAL xmax, xmin, ymax, ymin, zmax, zmin;
1471 REAL big_radius_edge_ratio;
1472 REAL smallest_insradius;
1474 long insert_point_count;
1475 long report_refine_progress;
1476 long last_point_count;
1477 long last_insertion_count;
1487 long duplicated_facets_count;
1488 long nonregularcount;
1489 long st_segref_count, st_facref_count, st_volref_count;
1490 long fillregioncount, cavitycount, cavityexpcount;
1491 long flip14count, flip26count, flipn2ncount;
1492 long flip23count, flip32count, flip44count, flip41count;
1493 long flip31count, flip22count;
1494 long opt_flips_count, opt_collapse_count, opt_smooth_count;
1495 long recover_delaunay_count;
1496 unsigned long totalworkmemory;
1506 static int bondtbl[12][12], fsymtbl[12][12];
1507 static int esymtbl[12], enexttbl[12], eprevtbl[12];
1508 static int enextesymtbl[12], eprevesymtbl[12];
1509 static int eorgoppotbl[12], edestoppotbl[12];
1510 static int facepivot1[12], facepivot2[12][12];
1511 static int orgpivot[12], destpivot[12], apexpivot[12], oppopivot[12];
1512 static int tsbondtbl[12][6], stbondtbl[12][6];
1513 static int tspivottbl[12][6], stpivottbl[12][6];
1514 static int ver2edge[12], edge2ver[6], epivot[12];
1515 static int sorgpivot [6], sdestpivot[6], sapexpivot[6];
1516 static int snextpivot[6];
1521 inline tetrahedron encode(triface& t);
1522 inline tetrahedron encode2(tetrahedron* ptr,
int ver);
1523 inline void decode(tetrahedron ptr, triface& t);
1524 inline tetrahedron* decode_tet_only(tetrahedron ptr);
1525 inline int decode_ver_only(tetrahedron ptr);
1526 inline void bond(triface& t1, triface& t2);
1527 inline void dissolve(triface& t);
1528 inline void esym(triface& t1, triface& t2);
1529 inline void esymself(triface& t);
1530 inline void enext(triface& t1, triface& t2);
1531 inline void enextself(triface& t);
1532 inline void eprev(triface& t1, triface& t2);
1533 inline void eprevself(triface& t);
1534 inline void enextesym(triface& t1, triface& t2);
1535 inline void enextesymself(triface& t);
1536 inline void eprevesym(triface& t1, triface& t2);
1537 inline void eprevesymself(triface& t);
1538 inline void eorgoppo(triface& t1, triface& t2);
1539 inline void eorgoppoself(triface& t);
1540 inline void edestoppo(triface& t1, triface& t2);
1541 inline void edestoppoself(triface& t);
1542 inline void fsym(triface& t1, triface& t2);
1543 inline void fsymself(triface& t);
1544 inline void fnext(triface& t1, triface& t2);
1545 inline void fnextself(triface& t);
1546 inline point org (triface& t);
1547 inline point dest(triface& t);
1548 inline point apex(triface& t);
1549 inline point oppo(triface& t);
1550 inline void setorg (triface& t, point p);
1551 inline void setdest(triface& t, point p);
1552 inline void setapex(triface& t, point p);
1553 inline void setoppo(triface& t, point p);
1554 inline REAL elemattribute(tetrahedron* ptr,
int attnum);
1555 inline void setelemattribute(tetrahedron* ptr,
int attnum, REAL value);
1556 inline REAL* get_polar(tetrahedron* ptr);
1557 inline REAL get_volume(tetrahedron* ptr);
1558 inline REAL volumebound(tetrahedron* ptr);
1559 inline void setvolumebound(tetrahedron* ptr, REAL value);
1560 inline int elemindex(tetrahedron* ptr);
1561 inline void setelemindex(tetrahedron* ptr,
int value);
1562 inline int elemmarker(tetrahedron* ptr);
1563 inline void setelemmarker(tetrahedron* ptr,
int value);
1564 inline void infect(triface& t);
1565 inline void uninfect(triface& t);
1566 inline bool infected(triface& t);
1567 inline void marktest(triface& t);
1568 inline void unmarktest(triface& t);
1569 inline bool marktested(triface& t);
1570 inline void markface(triface& t);
1571 inline void unmarkface(triface& t);
1572 inline bool facemarked(triface& t);
1573 inline void markedge(triface& t);
1574 inline void unmarkedge(triface& t);
1575 inline bool edgemarked(triface& t);
1576 inline void marktest2(triface& t);
1577 inline void unmarktest2(triface& t);
1578 inline bool marktest2ed(triface& t);
1579 inline int elemcounter(triface& t);
1580 inline void setelemcounter(triface& t,
int value);
1581 inline void increaseelemcounter(triface& t);
1582 inline void decreaseelemcounter(triface& t);
1583 inline bool ishulltet(triface& t);
1584 inline bool isdeadtet(triface& t);
1587 inline void sdecode(shellface sptr, face& s);
1588 inline shellface sencode(face& s);
1589 inline shellface sencode2(shellface *sh,
int shver);
1590 inline void spivot(face& s1, face& s2);
1591 inline void spivotself(face& s);
1592 inline void sbond(face& s1, face& s2);
1593 inline void sbond1(face& s1, face& s2);
1594 inline void sdissolve(face& s);
1595 inline point sorg(face& s);
1596 inline point sdest(face& s);
1597 inline point sapex(face& s);
1598 inline void setsorg(face& s, point pointptr);
1599 inline void setsdest(face& s, point pointptr);
1600 inline void setsapex(face& s, point pointptr);
1601 inline void sesym(face& s1, face& s2);
1602 inline void sesymself(face& s);
1603 inline void senext(face& s1, face& s2);
1604 inline void senextself(face& s);
1605 inline void senext2(face& s1, face& s2);
1606 inline void senext2self(face& s);
1607 inline REAL areabound(face& s);
1608 inline void setareabound(face& s, REAL value);
1609 inline int shellmark(face& s);
1610 inline void setshellmark(face& s,
int value);
1611 inline void sinfect(face& s);
1612 inline void suninfect(face& s);
1613 inline bool sinfected(face& s);
1614 inline void smarktest(face& s);
1615 inline void sunmarktest(face& s);
1616 inline bool smarktested(face& s);
1617 inline void smarktest2(face& s);
1618 inline void sunmarktest2(face& s);
1619 inline bool smarktest2ed(face& s);
1620 inline void smarktest3(face& s);
1621 inline void sunmarktest3(face& s);
1622 inline bool smarktest3ed(face& s);
1623 inline void setfacetindex(face& f,
int value);
1624 inline int getfacetindex(face& f);
1625 inline bool isdeadsh(face& s);
1628 inline void tsbond(triface& t, face& s);
1629 inline void tsdissolve(triface& t);
1630 inline void stdissolve(face& s);
1631 inline void tspivot(triface& t, face& s);
1632 inline void stpivot(face& s, triface& t);
1635 inline void tssbond1(triface& t, face& seg);
1636 inline void sstbond1(face& s, triface& t);
1637 inline void tssdissolve1(triface& t);
1638 inline void sstdissolve1(face& s);
1639 inline void tsspivot1(triface& t, face& s);
1640 inline void sstpivot1(face& s, triface& t);
1643 inline void ssbond(face& s, face& edge);
1644 inline void ssbond1(face& s, face& edge);
1645 inline void ssdissolve(face& s);
1646 inline void sspivot(face& s, face& edge);
1649 inline int pointmark(point pt);
1650 inline void setpointmark(point pt,
int value);
1651 inline enum verttype pointtype(point pt);
1652 inline void setpointtype(point pt,
enum verttype value);
1653 inline int pointgeomtag(point pt);
1654 inline void setpointgeomtag(point pt,
int value);
1655 inline REAL pointgeomuv(point pt,
int i);
1656 inline void setpointgeomuv(point pt,
int i, REAL value);
1657 inline void pinfect(point pt);
1658 inline void puninfect(point pt);
1659 inline bool pinfected(point pt);
1660 inline void pmarktest(point pt);
1661 inline void punmarktest(point pt);
1662 inline bool pmarktested(point pt);
1663 inline void pmarktest2(point pt);
1664 inline void punmarktest2(point pt);
1665 inline bool pmarktest2ed(point pt);
1666 inline void pmarktest3(point pt);
1667 inline void punmarktest3(point pt);
1668 inline bool pmarktest3ed(point pt);
1669 inline tetrahedron point2tet(point pt);
1670 inline void setpoint2tet(point pt, tetrahedron value);
1671 inline shellface point2sh(point pt);
1672 inline void setpoint2sh(point pt, shellface value);
1673 inline point point2ppt(point pt);
1674 inline void setpoint2ppt(point pt, point value);
1675 inline tetrahedron point2bgmtet(point pt);
1676 inline void setpoint2bgmtet(point pt, tetrahedron value);
1677 inline void setpointinsradius(point pt, REAL value);
1678 inline REAL getpointinsradius(point pt);
1679 inline bool issteinerpoint(point pt);
1682 inline void point2tetorg(point pt, triface& t);
1683 inline void point2shorg(point pa, face& s);
1684 inline point farsorg(face& seg);
1685 inline point farsdest(face& seg);
1693 void tetrahedrondealloc(tetrahedron*);
1694 tetrahedron *tetrahedrontraverse();
1695 tetrahedron *alltetrahedrontraverse();
1696 void shellfacedealloc(memorypool*, shellface*);
1697 shellface *shellfacetraverse(memorypool*);
1698 void pointdealloc(point);
1699 point pointtraverse();
1701 void makeindex2pointmap(point*&);
1702 void makepoint2submap(memorypool*,
int*&, face*&);
1703 void maketetrahedron(triface*);
1704 void maketetrahedron2(triface*, point, point, point, point);
1705 void makeshellface(memorypool*, face*);
1706 void makepoint(point*,
enum verttype);
1708 void initializepools();
1730 REAL insphere_s(REAL*, REAL*, REAL*, REAL*, REAL*);
1731 REAL orient4d_s(REAL*, REAL*, REAL*, REAL*, REAL*,
1732 REAL, REAL, REAL, REAL, REAL);
1735 REAL incircle3d(point pa, point pb, point pc, point pd);
1738 int tri_edge_2d(point, point, point, point, point, point,
int,
int*,
int*);
1739 int tri_edge_tail(point,point,point,point,point,point,REAL,REAL,
int,
int*,
int*);
1740 int tri_edge_test(point, point, point, point, point, point,
int,
int*,
int*);
1743 int tri_edge_inter_tail(point, point, point, point, point, REAL, REAL);
1744 int tri_tri_inter(point, point, point, point, point, point);
1747 inline REAL dot(REAL* v1, REAL* v2);
1748 inline void cross(REAL* v1, REAL* v2, REAL* n);
1749 bool lu_decmp(REAL lu[4][4],
int n,
int* ps, REAL* d,
int N);
1750 void lu_solve(REAL lu[4][4],
int n,
int* ps, REAL* b,
int N);
1753 REAL orient3dfast(REAL *pa, REAL *pb, REAL *pc, REAL *pd);
1754 inline REAL norm2(REAL x, REAL y, REAL z);
1755 inline REAL distance(REAL* p1, REAL* p2);
1756 inline REAL distance2(REAL* p1, REAL* p2);
1757 void facenormal(point pa, point pb, point pc, REAL *n,
int pivot, REAL *lav);
1758 REAL facedihedral(REAL* pa, REAL* pb, REAL* pc1, REAL* pc2);
1759 REAL triarea(REAL* pa, REAL* pb, REAL* pc);
1760 REAL interiorangle(REAL* o, REAL* p1, REAL* p2, REAL* n);
1761 REAL cos_interiorangle(REAL* o, REAL* p1, REAL* p2);
1762 void projpt2edge(REAL* p, REAL* e1, REAL* e2, REAL* prj);
1763 void projpt2face(REAL* p, REAL* f1, REAL* f2, REAL* f3, REAL* prj);
1764 bool circumsphere(REAL*, REAL*, REAL*, REAL*, REAL* cent, REAL* radius);
1765 bool orthosphere(REAL*,REAL*,REAL*,REAL*,REAL,REAL,REAL,REAL,REAL*,REAL*);
1766 void planelineint(REAL*, REAL*, REAL*, REAL*, REAL*, REAL*, REAL*);
1767 int linelineint(REAL*, REAL*, REAL*, REAL*, REAL*, REAL*, REAL*, REAL*);
1768 REAL tetprismvol(REAL* pa, REAL* pb, REAL* pc, REAL* pd);
1769 bool calculateabovepoint(arraypool*, point*, point*, point*);
1770 void calculateabovepoint4(point, point, point, point);
1805 void flippush(badface*&, triface*);
1808 void flip23(triface*,
int, flipconstraints* fc);
1809 void flip32(triface*,
int, flipconstraints* fc);
1810 void flip41(triface*,
int, flipconstraints* fc);
1813 int flipnm(triface*,
int n,
int level,
int, flipconstraints* fc);
1814 int flipnm_post(triface*,
int n,
int nn,
int, flipconstraints* fc);
1817 int insertpoint(point, triface*, face*, face*, insertvertexflags*);
1818 void insertpoint_abort(face*, insertvertexflags*);
1879 void transfernodes();
1882 int transgc[8][3][8], tsb1mod3[8];
1883 void hilbert_init(
int n);
1884 int hilbert_split(point* vertexarray,
int arraysize,
int gc0,
int gc1,
1885 REAL, REAL, REAL, REAL, REAL, REAL);
1886 void hilbert_sort3(point* vertexarray,
int arraysize,
int e,
int d,
1887 REAL, REAL, REAL, REAL, REAL, REAL,
int depth);
1888 void brio_multiscale_sort(point*,
int,
int threshold,REAL ratio,
int* depth);
1891 unsigned long randomnation(
unsigned int choices);
1892 void randomsample(point searchpt, triface *searchtet);
1893 enum locateresult locate(point searchpt, triface *searchtet,
int chkencflag = 0);
1896 enum locateresult locate_dt(point searchpt, triface *searchtet);
1897 int insert_vertex_bw(point, triface*, insertvertexflags*);
1898 void initialdelaunay(point pa, point pb, point pc, point pd);
1899 void incrementaldelaunay(clock_t&);
1907 void flipshpush(face*);
1908 void flip22(face*,
int,
int);
1909 void flip31(face*,
int);
1911 int sinsertvertex(point newpt, face*, face*,
int iloc,
int bowywat,
int);
1912 int sremovevertex(point delpt, face*, face*,
int lawson);
1914 enum locateresult slocate(point, face*,
int,
int,
int);
1915 enum interresult sscoutsegment(face*, point,
int,
int,
int);
1916 void scarveholes(
int, REAL*);
1917 int triangulate(
int, arraypool*, arraypool*,
int, REAL*);
1919 void unifysegments();
1920 void identifyinputedges(point*);
1989 enum interresult finddirection(triface* searchtet, point endpt);
1990 enum interresult scoutsegment(point, point, face*, triface*, point*,
1992 int getsteinerptonsegment(face* seg, point refpt, point steinpt);
1993 void delaunizesegments();
1995 int scoutsubface(face* searchsh,triface* searchtet,
int shflag);
1996 void formregion(face*, arraypool*, arraypool*, arraypool*);
1997 int scoutcrossedge(triface& crosstet, arraypool*, arraypool*);
1998 bool formcavity(triface*, arraypool*, arraypool*, arraypool*, arraypool*,
1999 arraypool*, arraypool*);
2001 void delaunizecavity(arraypool*, arraypool*, arraypool*, arraypool*,
2002 arraypool*, arraypool*);
2003 bool fillcavity(arraypool*, arraypool*, arraypool*, arraypool*,
2004 arraypool*, arraypool*, triface* crossedge);
2005 void carvecavity(arraypool*, arraypool*, arraypool*);
2006 void restorecavity(arraypool*, arraypool*, arraypool*, arraypool*);
2008 void flipcertify(triface *chkface, badface **pqueue, point, point, point);
2009 void flipinsertfacet(arraypool*, arraypool*, arraypool*, arraypool*);
2011 int insertpoint_cdt(point, triface*, face*, face*, insertvertexflags*,
2012 arraypool*, arraypool*, arraypool*, arraypool*,
2013 arraypool*, arraypool*);
2014 void refineregion(face&, arraypool*, arraypool*, arraypool*, arraypool*,
2015 arraypool*, arraypool*);
2016 void constrainedfacets();
2018 void constraineddelaunay(clock_t&);
2026 void sort_2pts(point p1, point p2, point ppt[2]);
2027 void sort_3pts(point p1, point p2, point p3, point ppt[3]);
2029 bool is_collinear_at(point mid, point left, point right);
2030 bool is_segment(point p1, point p2);
2031 bool valid_constrained_f23(triface&, point pd, point pe);
2032 bool valid_constrained_f32(triface*, point pa, point pb);
2034 int checkflipeligibility(
int fliptype, point, point, point, point, point,
2035 int level,
int edgepivot, flipconstraints* fc);
2037 int removeedgebyflips(triface*, flipconstraints*);
2038 int removefacebyflips(triface*, flipconstraints*);
2040 int recoveredgebyflips(point, point, face*, triface*,
int fullsearch,
int& idir);
2041 int add_steinerpt_in_schoenhardtpoly(triface*,
int,
int,
int chkencflag);
2042 int add_steinerpt_in_segment(face*,
int searchlevel,
int& idir);
2043 int add_steinerpt_to_recover_edge(point, point, face*,
int,
int,
int& idir);
2044 int recoversegments(arraypool*,
int fullsearch,
int steinerflag);
2046 int recoverfacebyflips(point,point,point,face*,triface*,
int&,point*,point*);
2047 int recoversubfaces(arraypool*,
int steinerflag);
2049 int getvertexstar(
int, point searchpt, arraypool*, arraypool*, arraypool*);
2050 int getedge(point, point, triface*);
2051 int reduceedgesatvertex(point startpt, arraypool* endptlist);
2052 int removevertexbyflips(point steinerpt);
2054 int smoothpoint(point smtpt, arraypool*,
int ccw, optparameters *opm);
2055 int suppressbdrysteinerpoint(point steinerpt);
2056 int suppresssteinerpoints();
2058 void recoverboundary(clock_t&);
2068 void reconstructmesh();
2070 int search_face(point p0, point p1, point p2, triface &tetloop);
2071 int search_edge(point p0, point p1, triface &tetloop);
2072 int scout_point(point, triface*,
int randflag);
2073 REAL getpointmeshsize(point, triface*,
int iloc);
2074 void interpolatemeshsize();
2076 void insertconstrainedpoints(point *insertarray,
int arylen,
int rejflag);
2077 void insertconstrainedpoints(
tetgenio *addio);
2079 void collectremovepoints(arraypool *remptlist);
2080 void meshcoarsening();
2118 void makesegmentendpointsmap();
2119 REAL set_ridge_vertex_protecting_ball(point);
2120 REAL get_min_angle_at_ridge_vertex(face* seg);
2121 REAL get_min_diahedral_angle(face* seg);
2122 void create_segment_info_list();
2124 void makefacetverticesmap();
2125 void create_segment_facet_map();
2127 int ridge_vertices_adjacent(point, point);
2128 int facet_ridge_vertex_adjacent(face *, point);
2129 int segsegadjacent(face *, face *);
2130 int segfacetadjacent(face *checkseg, face *checksh);
2131 int facetfacetadjacent(face *, face *);
2132 bool is_sharp_segment(face* seg);
2133 bool does_seg_contain_acute_vertex(face* seg);
2134 bool create_a_shorter_edge(point steinerpt, point nearpt);
2136 void enqueuesubface(memorypool*, face*);
2137 void enqueuetetrahedron(triface*);
2139 bool check_encroachment(point pa, point pb, point checkpt);
2140 bool check_enc_segment(face *chkseg, point *pencpt);
2141 bool get_steiner_on_segment(face* seg, point encpt, point newpt);
2142 bool split_segment(face *splitseg, point encpt, REAL *param,
int qflag,
int,
int*);
2143 void repairencsegs(REAL *param,
int qflag,
int chkencflag);
2145 bool get_subface_ccent(face *chkfac, REAL *ccent);
2146 bool check_enc_subface(face *chkfac, point *pencpt, REAL *ccent, REAL *radius);
2147 bool check_subface(face *chkfac, REAL *ccent, REAL radius, REAL *param);
2148 void enqueue_subface(face *bface, point encpt, REAL *ccent, REAL *param);
2149 badface* top_subface();
2150 void dequeue_subface();
2151 void parallel_shift(point pa, point pb, point pc, point pt, REAL* ppt);
2152 enum locateresult locate_on_surface(point searchpt, face* searchsh);
2153 bool split_subface(face *splitfac, point encpt, REAL *ccent, REAL*,
int,
int,
int*);
2154 void repairencfacs(REAL *param,
int qflag,
int chkencflag);
2156 bool check_tetrahedron(triface *chktet, REAL* param,
int& qflag);
2157 bool checktet4split(triface *chktet, REAL* param,
int& qflag);
2158 enum locateresult locate_point_walk(point searchpt, triface*,
int chkencflag);
2159 bool split_tetrahedron(triface*, REAL*,
int,
int, insertvertexflags &ivf);
2160 void repairbadtets(REAL queratio,
int chkencflag);
2162 void delaunayrefinement();
2170 long lawsonflip3d(flipconstraints *fc);
2171 void recoverdelaunay();
2173 int get_seg_laplacian_center(point mesh_vert, REAL target[3]);
2174 int get_surf_laplacian_center(point mesh_vert, REAL target[3]);
2175 int get_laplacian_center(point mesh_vert, REAL target[3]);
2176 bool move_vertex(point mesh_vert, REAL target[3]);
2177 void smooth_vertices();
2179 bool get_tet(point, point, point, point, triface *);
2180 bool get_tetqual(triface *chktet, point oppo_pt, badface *bf);
2181 bool get_tetqual(point, point, point, point, badface *bf);
2182 void enqueue_badtet(badface *bf);
2183 badface* top_badtet();
2184 void dequeue_badtet();
2186 bool add_steinerpt_to_repair(badface *bf,
bool bSmooth);
2187 bool flip_edge_to_improve(triface *sliver_edge, REAL& improved_cosmaxd);
2188 bool repair_tet(badface *bf,
bool bFlips,
bool bSmooth,
bool bSteiners);
2189 long repair_badqual_tets(
bool bFlips,
bool bSmooth,
bool bSteiners);
2190 void improve_mesh();
2199 int check_mesh(
int topoflag);
2201 int check_segments();
2202 int check_delaunay(
int perturb = 1);
2203 int check_regular(
int);
2204 int check_conforming(
int);
2207 void printfcomma(
unsigned long n);
2208 void qualitystatistics();
2209 void memorystatistics();
2218 void jettisonnodes();
2220 void indexelements();
2232 void outsmesh(
char*);
2233 void outmesh2medit(
char*);
2234 void outmesh2vtk(
char*,
int);
2235 void out_surfmesh_vtk(
char*,
int);
2236 void out_intersected_facets();
2247 void initializetetgenmesh()
2253 tetrahedrons = subfaces = subsegs = points = NULL;
2254 tet2segpool = tet2subpool = NULL;
2257 badtetrahedrons = badsubfacs = badsubsegs = NULL;
2258 split_segments_pool = split_subfaces_pool = NULL;
2259 unsplit_badtets = unsplit_subfaces = unsplit_segments = NULL;
2260 check_tets_list = NULL;
2261 badqual_tets_pool = NULL;
2263 stack_enc_segments = stack_enc_subfaces = NULL;
2266 flipstack = unflip_queue_front = unflip_queue_tail = NULL;
2267 later_unflip_queue = unflipqueue = NULL;
2269 cavetetlist = cavebdrylist = caveoldtetlist = NULL;
2270 cave_oldtet_list = NULL;
2271 cavetetshlist = cavetetseglist = cavetetvertlist = NULL;
2272 caveencshlist = caveencseglist = NULL;
2273 caveshlist = caveshbdlist = cavesegshlist = NULL;
2275 subsegstack = subfacstack = subvertstack = NULL;
2276 skipped_segment_list = skipped_facet_list = NULL;
2278 encseglist = encshlist = NULL;
2280 number_of_facets = 0;
2281 idx2facetlist = NULL;
2282 facetverticeslist = NULL;
2283 idx_segment_facet_list = NULL;
2284 segment_facet_list = NULL;
2285 idx_ridge_vertex_facet_list = NULL;
2286 ridge_vertex_facet_list = NULL;
2288 segmentendpointslist_length = 0;
2289 segmentendpointslist = NULL;
2290 segment_info_list = NULL;
2291 idx_segment_ridge_vertex_list = NULL;
2292 segment_ridge_vertex_list = NULL;
2295 subdomain_markers = NULL;
2297 numpointattrib = numelemattrib = 0;
2300 pointparamindex = 0;
2303 pointinsradiusindex = 0;
2304 elemattribindex = 0;
2306 volumeboundindex = 0;
2309 checksubsegflag = 0;
2310 checksubfaceflag = 0;
2311 boundary_recovery_flag = 0;
2312 checkconstraints = 0;
2314 autofliplinklevel = 1;
2315 useinsertradius = 0;
2318 minfaceang = minfacetdihed = PI;
2319 cos_facet_separate_ang_tol = cos(179.9/180.*PI);
2320 cos_collinear_ang_tol = cos(179.9/180.*PI);
2321 tetprism_vol_sum = 0.0;
2322 longest = minedgelength = 0.0;
2323 xmax = xmin = ymax = ymin = zmax = zmin = 0.0;
2325 smallest_insradius = 1.e+30;
2326 big_radius_edge_ratio = 100.0;
2328 insert_point_count = 0l;
2329 report_refine_progress = 0l;
2330 last_point_count = 0l;
2331 last_insertion_count = 0l;
2335 meshedges = meshhulledges = 0l;
2339 duplicated_facets_count = 0l;
2340 nonregularcount = 0l;
2341 st_segref_count = st_facref_count = st_volref_count = 0l;
2342 fillregioncount = cavitycount = cavityexpcount = 0l;
2343 flip14count = flip26count = flipn2ncount = 0l;
2344 flip23count = flip32count = flip44count = flip41count = 0l;
2345 flip22count = flip31count = 0l;
2346 recover_delaunay_count = 0l;
2347 opt_flips_count = opt_collapse_count = opt_smooth_count = 0l;
2348 totalworkmemory = 0l;
2358 if (points != (memorypool *) NULL) {
2360 delete [] dummypoint;
2362 if (tetrahedrons != (memorypool *) NULL) {
2363 delete tetrahedrons;
2365 if (subfaces != (memorypool *) NULL) {
2369 if (tet2segpool != NULL) {
2374 if (badtetrahedrons) {
2375 delete badtetrahedrons;
2383 if (unsplit_badtets) {
2384 delete unsplit_badtets;
2386 if (check_tets_list) {
2387 delete check_tets_list;
2390 if (flippool != NULL) {
2392 delete later_unflip_queue;
2396 if (cavetetlist != NULL) {
2398 delete cavebdrylist;
2399 delete caveoldtetlist;
2400 delete cavetetvertlist;
2401 delete cave_oldtet_list;
2404 if (caveshlist != NULL) {
2406 delete caveshbdlist;
2407 delete cavesegshlist;
2408 delete cavetetshlist;
2409 delete cavetetseglist;
2410 delete caveencshlist;
2411 delete caveencseglist;
2414 if (subsegstack != NULL) {
2417 delete subvertstack;
2420 if (idx2facetlist != NULL) {
2421 delete [] idx2facetlist;
2422 delete [] facetverticeslist;
2423 delete [] idx_segment_facet_list;
2424 delete [] segment_facet_list;
2425 delete [] idx_ridge_vertex_facet_list;
2426 delete [] ridge_vertex_facet_list;
2429 if (segmentendpointslist != NULL) {
2430 delete [] segmentendpointslist;
2431 delete [] idx_segment_ridge_vertex_list;
2432 delete [] segment_ridge_vertex_list;
2435 if (segment_info_list != NULL) {
2436 delete [] segment_info_list;
2439 if (subdomain_markers != NULL) {
2440 delete [] subdomain_markers;
2443 initializetetgenmesh();
2448 initializetetgenmesh();