Back to index

radiance  4R0+20100331
Classes | Defines | Functions
tmesh.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BARYCCM

Defines

#define TCALNAME   "tmesh.cal" /* the name of our auxiliary file */
#define COSTOL   0.999995 /* cosine of tolerance for smoothing */
#define ISBENT   0 /* is not flat */
#define ISFLAT   1 /* is flat */
#define RVBENT   2 /* reversed and not flat */
#define RVFLAT   3 /* reversed and flat */
#define DEGEN   -1 /* degenerate (zero area) */

Functions

int flat_tri (FVECT v1, FVECT v2, FVECT v3, FVECT n1, FVECT n2, FVECT n3)
int comp_baryc (BARYCCM *bcm, FVECT v1, FVECT v2, FVECT v3)
void eval_baryc (RREAL wt[3], FVECT p, BARYCCM *bcm)
int get_baryc (RREAL wt[3], FVECT p, FVECT v1, FVECT v2, FVECT v3)
void put_baryc (BARYCCM *bcm, RREAL com[][3], int n)

Class Documentation

struct BARYCCM

Definition at line 14 of file tmesh.h.

Class Members
int ax
RREAL tm

Define Documentation

#define COSTOL   0.999995 /* cosine of tolerance for smoothing */

Definition at line 20 of file tmesh.h.

#define DEGEN   -1 /* degenerate (zero area) */

Definition at line 28 of file tmesh.h.

#define ISBENT   0 /* is not flat */

Definition at line 24 of file tmesh.h.

#define ISFLAT   1 /* is flat */

Definition at line 25 of file tmesh.h.

#define RVBENT   2 /* reversed and not flat */

Definition at line 26 of file tmesh.h.

#define RVFLAT   3 /* reversed and flat */

Definition at line 27 of file tmesh.h.

#define TCALNAME   "tmesh.cal" /* the name of our auxiliary file */

Definition at line 12 of file tmesh.h.


Function Documentation

int comp_baryc ( BARYCCM bcm,
FVECT  v1,
FVECT  v2,
FVECT  v3 
)
void eval_baryc ( RREAL  wt[3],
FVECT  p,
BARYCCM bcm 
)
int flat_tri ( FVECT  v1,
FVECT  v2,
FVECT  v3,
FVECT  n1,
FVECT  n2,
FVECT  n3 
)

Definition at line 18 of file tmesh.c.

{
       double d1, d2, d3;
       FVECT  vt1, vt2, vn;
                                   /* compute default normal */
       VSUB(vt1, v2, v1);
       VSUB(vt2, v3, v2);
       VCROSS(vn, vt1, vt2);
       if (normalize(vn) == 0.0)
              return(DEGEN);
                                   /* compare to supplied normals */
       d1 = DOT(vn, n1); d2 = DOT(vn, n2); d3 = DOT(vn, n3);
       if (d1 < 0 && d2 < 0 && d3 < 0) {
              if (d1 > -COSTOL || d2 > -COSTOL || d3 > -COSTOL)
                     return(RVBENT);
              return(RVFLAT);
       }
       if (d1 < COSTOL || d2 < COSTOL || d3 < COSTOL)
              return(ISBENT);
       return(ISFLAT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int get_baryc ( RREAL  wt[3],
FVECT  p,
FVECT  v1,
FVECT  v2,
FVECT  v3 
)
void put_baryc ( BARYCCM bcm,
RREAL  com[][3],
int  n 
)