BRL-CAD
tri_intersect.c File Reference
#include "common.h"
#include <math.h>
#include <string.h>
#include "vmath.h"
#include "bn.h"
#include "gcv.h"
#include "soup.h"
#include "tri_intersect.h"
Include dependency graph for tri_intersect.c:

Go to the source code of this file.

Macros

#define SORT2(a, b, smallest)   if (a>b) { fastf_t _c; _c=a; a=b; b=_c; smallest=1; }
 

Functions

void gcv_fisect2 (point_t VTX0, point_t VTX1, point_t VTX2, fastf_t VV0, fastf_t VV1, fastf_t VV2, fastf_t D0, fastf_t D1, fastf_t D2, fastf_t *isect0, fastf_t *isect1, point_t *isectpoint0, point_t *isectpoint1)
 
int gcv_compute_intervals_isectline (struct face_s *f, fastf_t VV0, fastf_t VV1, fastf_t VV2, fastf_t D0, fastf_t D1, fastf_t D2, fastf_t D0D1, fastf_t D0D2, fastf_t *isect0, fastf_t *isect1, point_t *isectpoint0, point_t *isectpoint1, const struct bn_tol *tol)
 
int gcv_edge_edge_test (point_t V0, point_t U0, point_t U1, fastf_t Ax, fastf_t Ay, int i0, int i1)
 
int gcv_edge_against_tri_edges (point_t V0, point_t V1, point_t U0, point_t U1, point_t U2, int i0, int i1)
 
int gcv_point_in_tri (point_t V0, point_t U0, point_t U1, point_t U2, int i0, int i1)
 
int gcv_coplanar_tri_tri (vect_t N, vect_t V0, vect_t V1, vect_t V2, vect_t U0, vect_t U1, vect_t U2)
 
int gcv_tri_tri_intersect_with_isectline (struct soup_s *left, struct soup_s *right, struct face_s *lf, struct face_s *rf, int *coplanar, point_t *isectpt, const struct bn_tol *tol)
 

Detailed Description

Intersect 2 triangles using a modified Möller routine.

Definition in file tri_intersect.c.

Macro Definition Documentation

#define SORT2 (   a,
  b,
  smallest 
)    if (a>b) { fastf_t _c; _c=a; a=b; b=_c; smallest=1; }

Function Documentation

void gcv_fisect2 ( point_t  VTX0,
point_t  VTX1,
point_t  VTX2,
fastf_t  VV0,
fastf_t  VV1,
fastf_t  VV2,
fastf_t  D0,
fastf_t  D1,
fastf_t  D2,
fastf_t isect0,
fastf_t isect1,
point_t *  isectpoint0,
point_t *  isectpoint1 
)

Definition at line 43 of file tri_intersect.c.

Referenced by gcv_compute_intervals_isectline().

int gcv_compute_intervals_isectline ( struct face_s f,
fastf_t  VV0,
fastf_t  VV1,
fastf_t  VV2,
fastf_t  D0,
fastf_t  D1,
fastf_t  D2,
fastf_t  D0D1,
fastf_t  D0D2,
fastf_t isect0,
fastf_t isect1,
point_t *  isectpoint0,
point_t *  isectpoint1,
const struct bn_tol tol 
)

Definition at line 67 of file tri_intersect.c.

References bn_tol::dist, gcv_fisect2(), NEAR_ZERO, and face_s::vert.

Referenced by gcv_tri_tri_intersect_with_isectline().

Here is the call graph for this function:

int gcv_edge_edge_test ( point_t  V0,
point_t  U0,
point_t  U1,
fastf_t  Ax,
fastf_t  Ay,
int  i0,
int  i1 
)

Definition at line 95 of file tri_intersect.c.

Referenced by gcv_edge_against_tri_edges().

int gcv_edge_against_tri_edges ( point_t  V0,
point_t  V1,
point_t  U0,
point_t  U1,
point_t  U2,
int  i0,
int  i1 
)

Definition at line 118 of file tri_intersect.c.

References gcv_edge_edge_test().

Referenced by gcv_coplanar_tri_tri().

Here is the call graph for this function:

int gcv_point_in_tri ( point_t  V0,
point_t  U0,
point_t  U1,
point_t  U2,
int  i0,
int  i1 
)

Definition at line 134 of file tri_intersect.c.

Referenced by gcv_coplanar_tri_tri().

int gcv_coplanar_tri_tri ( vect_t  N,
vect_t  V0,
vect_t  V1,
vect_t  V2,
vect_t  U0,
vect_t  U1,
vect_t  U2 
)

Definition at line 160 of file tri_intersect.c.

References A, gcv_edge_against_tri_edges(), and gcv_point_in_tri().

Referenced by gcv_tri_tri_intersect_with_isectline().

Here is the call graph for this function:

int gcv_tri_tri_intersect_with_isectline ( struct soup_s left,
struct soup_s right,
struct face_s lf,
struct face_s rf,
int *  coplanar,
point_t *  isectpt,
const struct bn_tol tol 
)

Definition at line 201 of file tri_intersect.c.

References gcv_compute_intervals_isectline(), gcv_coplanar_tri_tri(), face_s::plane, SORT2, and face_s::vert.

Referenced by split_face(), and test_intersection().

Here is the call graph for this function: