ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/tmesh.h
Revision: 2.7
Committed: Thu Apr 15 23:51:04 2021 UTC (3 years, 1 month ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, HEAD
Changes since 2.6: +3 -2 lines
Log Message:
feat(genbox,robjutil): Added Radiance normal smoothing support to wfobj library

File Contents

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