gCAD3D 2.40
ut_itmsh.h
Go to the documentation of this file.
1 // ITMSH irregular-triangle-mesh generarator functions
2 //
3 // prerequisites:
4 // #include "../ut/ut_geo.h" // Point ...
5 // #include "../ut/ut_memTab.h" // MemTab_..
6 
7 
8 
9 #define MSH_EDGLN_BL 1 // BreakLine
10 #define MSH_EDGLN_AB 2 // OuterBound - automatic created
11 #define MSH_EDGLN_IB 3 // InnerBound - user defined points
12 #define MSH_EDGLN_OB 4 // OuterBound - user defined points
13 #define MSH_EDGLN_IC 5 // InnerBound - computed points
14 #define MSH_EDGLN_OC 6 // OuterBound - computed points
15 #define MSH_EDGLN_LN 7 // lines (test)
16 #define MSH_EDGLN_SB -1 // surface-boundary (tile)
17 #define MSH_EDGLN_ERR -16 // unset, invalid ..
18 #define MSH_GRIDBOX 8 // points in a rectangular grid
19 #define MSH_nFAC 9 // indexed faces (Fac3)
20 #define MSH_PATCH 10 // patch = group of faces (eg from GLU)
21 #define MSH_SURF 11 // surface = group of patches
22 #define MSH_SKIN 12 // skin = group of surfaces; body if closed.
23 
24 
25 
31 typedef struct {Point *pTab; int pNr; char *pTyp;} Verts;
32 
33 
38 typedef struct {int *ipt; int *inf;} Face;
39 
40 
45 typedef struct {int i1, i2, i3, st;} Fac3;
46 
47 
54 typedef struct {void *fTab; int fNr; int fTyp;} Faces;
55 
56 
68 typedef struct {int ip1, ip2, ip3, if1, if2, if3;} FacNf;
69 
70 
72 typedef struct {int ipt[2];} Edge;
73 
74 
76 typedef struct {int i1, i2;} Edg3;
77 
78 
86 typedef struct {int *ia, iNr; char typ, aux, stat;} EdgeLine;
87 
88 
97 typedef struct {Edge *eTab; int eNr; char *eTyp;} Edges;
98 
99 
106 typedef struct {Verts *p; Faces *f; Edges *e; int mTyp;} Mesh;
107 
108 
114 typedef struct {int ipt, nbsid;} SegBnd;
115 
116 /*
124 typedef struct {int vxSt, vxNr, vxMax, surNb;} EdgSur;
125 */
126 
127 
141 typedef struct {int suID, contNr; char typb, typt, dir, stat;} BndSur;
142 // ^
143 
144 
145 /*
155 typedef struct {int ibeg, iNr; char typi, typd, aux, stat;} IndTab;
156 // size = 12
157 */
158 
159 //----------------------------------------------------------------
160 // ut_tria
161 
166 #define UT3D_ck_triaOrientI(i0,i1)\
167  (((((i0)==0)&&((i1)==1))||(((i0)==1)&&((i1)==2))||(((i0)==2)&&((i1)==0))) ? CCW : CW)
168 
173 #define UT3D_ck_triaOrientV(i0,i1)\
174  (((((i0)==1)&&((i1)==2))||(((i0)==2)&&((i1)==4))||(((i0)==4)&&((i1)==1))) ? CCW : CW)
175 
179 #define UT3D_ind3Tria_2ind(i1,i2) (IABS((i1)+(i2)-3))
180 
182 void UT3D_tria_fac(Triangle*, Fac3*, Point*);
183 #define UT3D_tria_fac(tri,fac,pTab){\
184  (tri)->pa[0] = &(pTab)[(fac)->i1];\
185  (tri)->pa[1] = &(pTab)[(fac)->i2];\
186  (tri)->pa[2] = &(pTab)[(fac)->i3];}
187 
188 
189 
190 // estimate nr of faces necessary for edgNr edges
191 // In: nr of edges; Out: nr of faces
192 #define MSH2D_facnr_edgnr(edgNr) edgNr+4
193 
194 // MSH2D_edgnr_facnr estimate nr of edges for facnr faces
195 #define MSH2D_edgnr_facnr(facNr) (facNr*3)+1
196 
197 
198 
199 
200 //----------------------------------------------------------------
201 typedef_MemTab(int);
202 typedef_MemTab(char);
210 
211 // DOES NOT WORK:
212 // #define MemTab_int MemTab
213 // #define MemTab_char MemTab
214 // #define MemTab_Point2 MemTab
215 // #define MemTab_Point MemTab
216 // #define MemTab_Vec3f MemTab
217 // #define MemTab_Line MemTab
218 // #define MemTab_Fac3 MemTab
219 // #define MemTab_EdgeLine MemTab
220 // #define MemTab_IndTab MemTab
221 // EOF
char * eTyp
Definition: ut_itmsh.h:97
static int contNr
Definition: xa_cont.c:97
char * pTyp
Definition: ut_itmsh.h:31
int st
Definition: ut_itmsh.h:45
3D-line, Typ_LN
Definition: ut_geo.h:367
int fTyp
Definition: ut_itmsh.h:54
Verts * p
Definition: ut_itmsh.h:106
i1, i2 index to points
Definition: ut_itmsh.h:76
char stat
Definition: xa_tra.c:152
char typt
Definition: ut_itmsh.h:141
triangle, Typ_Tria
Definition: tessbug1.c:71
int fNr
Definition: doxy_help1.c:38
Definition: ut_itmsh.h:31
Face with NeigbourFaces.
Definition: ut_itmsh.h:68
Typ_EdgSur.
Definition: ut_itmsh.h:114
Definition: ut_itmsh.h:54
#define UT3D_tria_fac(tri, fac, pTab)
3D-point, Typ_PT
Definition: tessbug1.c:66
#define typedef_MemTab(vTyp1)
template for the typedef:
Definition: ut_memTab.h:32
char ** fTab
Definition: doxy_help1.c:39
3D-vector, Typ_VC3F
Definition: tst_glDrawElements1.c:61
char typ
Definition: ut_itmsh.h:86
int * ipt
Definition: ut_itmsh.h:38
Typ_SURBND.
Definition: ut_itmsh.h:141
2D-point, Typ_PT2
Definition: ut_geo.h:190
int i2
Definition: ut_itmsh.h:76
Definition: ut_itmsh.h:45
int nbsid
Definition: ut_itmsh.h:114
Typ_EdgeLine.
Definition: ut_itmsh.h:86
Definition: ut_itmsh.h:97
Typ_SURMSH 2007-03-24 TB.
Definition: ut_itmsh.h:106
Definition: ut_itmsh.h:38
int ip3
Definition: ut_itmsh.h:68
Index-table; Typ_IndTab; _INDTAB_NUL.
Definition: ut_geo.h:227
ipt: index points;
Definition: ut_itmsh.h:72