ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/tmesh.h
Revision: 2.4
Committed: Fri Jun 6 16:38:47 2003 UTC (21 years, 5 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 2.3: +12 -11 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 schorsch 2.4 /* RCSid $Id: tmesh.h,v 2.3 2003/03/12 04:59:04 greg Exp $ */
2 greg 2.1 /*
3     * Header file for triangle mesh routines using barycentric coordinates
4     */
5 schorsch 2.4 #ifndef _RAD_TMESH_H_
6     #define _RAD_TMESH_H_
7     #ifdef __cplusplus
8     extern "C" {
9     #endif
10 greg 2.1
11     #define TCALNAME "tmesh.cal" /* the name of our auxiliary file */
12    
13     typedef struct {
14     int ax; /* major axis */
15     FLOAT tm[2][3]; /* transformation */
16     } BARYCCM;
17    
18     #ifndef COSTOL
19 greg 2.3 #define COSTOL 0.999995 /* cosine of tolerance for smoothing */
20 greg 2.1 #endif
21    
22     /* flat_tri() return values */
23     #define ISBENT 0 /* is not flat */
24     #define ISFLAT 1 /* is flat */
25     #define RVBENT 2 /* reversed and not flat */
26     #define RVFLAT 3 /* reversed and flat */
27     #define DEGEN -1 /* degenerate (zero area) */
28 greg 2.2
29    
30     int flat_tri(FVECT v1, FVECT v2, FVECT v3,
31     FVECT n1, FVECT n2, FVECT n3);
32     int comp_baryc(BARYCCM *bcm, FVECT v1, FVECT v2, FVECT v3);
33     void eval_baryc(FLOAT wt[3], FVECT p, BARYCCM *bcm);
34     int get_baryc(FLOAT wt[3], FVECT p, FVECT v1, FVECT v2, FVECT v3);
35     void put_baryc(BARYCCM *bcm, FLOAT com[][3], int n);
36    
37 schorsch 2.4
38     #ifdef __cplusplus
39     }
40     #endif
41     #endif /* _RAD_TMESH_H_ */
42