Back to index

radiance  4R0+20100331
tmesh.h
Go to the documentation of this file.
00001 /* RCSid $Id: tmesh.h,v 2.5 2003/06/26 00:58:09 schorsch Exp $ */
00002 /*
00003  * Header file for triangle mesh routines using barycentric coordinates
00004  */
00005 #ifndef _RAD_TMESH_H_
00006 #define _RAD_TMESH_H_
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 
00012 #define TCALNAME     "tmesh.cal"   /* the name of our auxiliary file */
00013 
00014 typedef struct {
00015        int    ax;           /* major axis */
00016        RREAL  tm[2][3];     /* transformation */
00017 } BARYCCM;
00018 
00019 #ifndef COSTOL
00020 #define COSTOL              0.999995      /* cosine of tolerance for smoothing */
00021 #endif
00022 
00023                             /* flat_tri() return values */
00024 #define ISBENT              0             /* is not flat */
00025 #define ISFLAT              1             /* is flat */
00026 #define RVBENT              2             /* reversed and not flat */
00027 #define RVFLAT              3             /* reversed and flat */
00028 #define DEGEN        -1            /* degenerate (zero area) */
00029 
00030 
00031 int           flat_tri(FVECT v1, FVECT v2, FVECT v3,
00032                             FVECT n1, FVECT n2, FVECT n3);
00033 int           comp_baryc(BARYCCM *bcm,  FVECT v1, FVECT v2, FVECT v3);
00034 void          eval_baryc(RREAL wt[3], FVECT p, BARYCCM *bcm);
00035 int           get_baryc(RREAL wt[3], FVECT p, FVECT v1, FVECT v2, FVECT v3);
00036 void          put_baryc(BARYCCM *bcm, RREAL com[][3], int n);
00037 
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 #endif /* _RAD_TMESH_H_ */
00043