BRL-CAD
tri_face.c File Reference
#include "common.h"
#include "bu/malloc.h"
#include "nmg.h"
#include "raytrace.h"
Include dependency graph for tri_face.c:

Go to the source code of this file.

Functions

HIDDEN struct shell * get_first_shell (struct model *model)
 
HIDDEN struct model * get_faceuse_model (struct faceuse *fu)
 
HIDDEN struct vertex_g * make_nmg_vertex_g (struct model *model, double x, double y, double z, long index)
 
HIDDEN struct vertex * make_nmg_vertex (struct model *model, double x, double y, double z, long index)
 
HIDDEN void attach_face_g_plane (struct model *model, struct face *f)
 
HIDDEN struct model * make_model_from_face (const double points[], int numPoints)
 
struct faceuse * make_faceuse_from_face (const double points[], int numPoints)
 
HIDDEN int getPointReference (const double point[], const double points[], size_t numPoints, double tol)
 
void triangulateFace (int **faces, size_t *numFaces, const double points[], size_t numPoints, struct bn_tol tol)
 

Detailed Description

Implements triangulateFace routine for triangulating convex/concave planar N-gons. Uses nmg for triangulation, but accepts and returns simple arrays.

Definition in file tri_face.c.

Function Documentation

HIDDEN struct shell* get_first_shell ( struct model *  model)

Definition at line 38 of file tri_face.c.

References BU_LIST_FIRST.

Referenced by make_faceuse_from_face(), and make_model_from_face().

HIDDEN struct model* get_faceuse_model ( struct faceuse *  fu)

Definition at line 50 of file tri_face.c.

Referenced by triangulateFace().

HIDDEN struct vertex_g* make_nmg_vertex_g ( struct model *  model,
double  x,
double  y,
double  z,
long  index 
)

Definition at line 58 of file tri_face.c.

References NMG_VERTEX_G_MAGIC, and VSET.

Referenced by make_nmg_vertex().

HIDDEN struct vertex* make_nmg_vertex ( struct model *  model,
double  x,
double  y,
double  z,
long  index 
)

Definition at line 72 of file tri_face.c.

References BU_LIST_INIT, make_nmg_vertex_g(), NMG_VERTEX_MAGIC, and OSL::Strings::v.

Referenced by make_model_from_face().

Here is the call graph for this function:

HIDDEN void attach_face_g_plane ( struct model *  model,
struct face *  f 
)

Definition at line 87 of file tri_face.c.

References BU_LIST_INIT, BU_LIST_PUSH, and NMG_FACE_G_PLANE_MAGIC.

Referenced by make_model_from_face().

HIDDEN struct model* make_model_from_face ( const double  points[],
int  numPoints 
)

Definition at line 105 of file tri_face.c.

References attach_face_g_plane(), bu_free(), BU_LIST_FIRST, bu_malloc(), get_first_shell(), make_nmg_vertex(), nmg_calc_face_plane(), nmg_cface(), nmg_km(), nmg_mm(), nmg_mrsv(), X, Y, and Z.

Referenced by make_faceuse_from_face().

Here is the call graph for this function:

struct faceuse* make_faceuse_from_face ( const double  points[],
int  numPoints 
)

Definition at line 146 of file tri_face.c.

References BU_LIST_FIRST, get_first_shell(), and make_model_from_face().

Referenced by triangulateFace().

Here is the call graph for this function:

HIDDEN int getPointReference ( const double  point[],
const double  points[],
size_t  numPoints,
double  tol 
)

Definition at line 171 of file tri_face.c.

Referenced by triangulateFace().

void triangulateFace ( int **  faces,
size_t *  numFaces,
const double  points[],
size_t  numPoints,
struct bn_tol  tol 
)

Definition at line 199 of file tri_face.c.

References BU_LIST_FOR, bu_malloc(), bn_tol::dist, get_faceuse_model(), getPointReference(), lu, make_faceuse_from_face(), nmg_km(), and nmg_triangulate_fu().

Here is the call graph for this function: