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

Go to the source code of this file.

Macros

#define VERT_INT   0x10
 
#define LINE_INT   0x20
 
#define FACE_INT   0x40
 
#define ALL_INT   (VERT_INT|LINE_INT|FACE_INT)
 

Functions

int soup_rm_face (struct soup_s *s, unsigned long int i)
 
int soup_add_face_precomputed (struct soup_s *s, point_t a, point_t b, point_t c, plane_t d, uint32_t foo)
 
int soup_add_face (struct soup_s *s, point_t a, point_t b, point_t c, const struct bn_tol *tol)
 
int split_face_single (struct soup_s *s, unsigned long int fid, point_t isectpt[2], struct face_s *opp_face, const struct bn_tol *tol)
 
int split_face (struct soup_s *left, unsigned long int left_face, struct soup_s *right, unsigned long int right_face, const struct bn_tol *tol)
 
struct soup_sbot2soup (struct rt_bot_internal *bot, const struct bn_tol *tol)
 
void free_soup (struct soup_s *s)
 
union treeinvert (union tree *tree)
 
void split_faces (union tree *left_tree, union tree *right_tree, const struct bn_tol *tol)
 
union treecompose (union tree *left_tree, union tree *right_tree, unsigned long int face_status1, unsigned long int face_status2, unsigned long int face_status3)
 
union treeevaluate (union tree *tr, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
 
union treegcv_bottess_region_end (struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
 
union treegcv_bottess (int argc, const char **argv, struct db_i *dbip, struct rt_tess_tol *ttol)
 

Variables

const int faces_per_page = 4096 / sizeof(struct face_s)
 
long int splitz = 0
 
long int splitty = 0
 
long int lsplitz =0
 
long int lsplitty =0
 

Macro Definition Documentation

#define VERT_INT   0x10

Referenced by split_face_single().

#define LINE_INT   0x20

Referenced by split_face_single().

#define FACE_INT   0x40

Referenced by split_face_single().

#define ALL_INT   (VERT_INT|LINE_INT|FACE_INT)

Referenced by split_face_single().

Function Documentation

int soup_rm_face ( struct soup_s s,
unsigned long int  i 
)

Definition at line 48 of file bottess.c.

References bu_bomb(), bu_log(), soup_s::faces, and soup_s::nfaces.

Referenced by split_face_single().

Here is the call graph for this function:

int soup_add_face_precomputed ( struct soup_s s,
point_t  a,
point_t  b,
point_t  c,
plane_t  d,
uint32_t  foo 
)

Definition at line 60 of file bottess.c.

References bu_realloc(), soup_s::faces, faces_per_page, face_s::foo, face_s::max, soup_s::maxfaces, face_s::min, soup_s::nfaces, face_s::plane, face_s::vert, X, Y, and Z.

Referenced by soup_add_face(), and split_face_single().

Here is the call graph for this function:

int soup_add_face ( struct soup_s s,
point_t  a,
point_t  b,
point_t  c,
const struct bn_tol tol 
)

Definition at line 101 of file bottess.c.

References bn_mk_plane_3pts(), OUTSIDE, and soup_add_face_precomputed().

Referenced by bot2soup(), test_compose(), and test_face_splits().

Here is the call graph for this function:

int split_face_single ( struct soup_s s,
unsigned long int  fid,
point_t  isectpt[2],
struct face_s opp_face,
const struct bn_tol tol 
)

Definition at line 115 of file bottess.c.

References ALL_INT, bn_isect_pt_lseg(), bu_bomb(), bu_log(), FACE_INT, soup_s::faces, INSIDE, LINE_INT, OUTSIDE, face_s::plane, soup_add_face_precomputed(), soup_rm_face(), face_s::vert, and VERT_INT.

Referenced by split_face().

Here is the call graph for this function:

int split_face ( struct soup_s left,
unsigned long int  left_face,
struct soup_s right,
unsigned long int  right_face,
const struct bn_tol tol 
)

Definition at line 248 of file bottess.c.

References bn_tol::dist, soup_s::faces, gcv_tri_tri_intersect_with_isectline(), split_face_single(), splitty, and splitz.

Referenced by split_faces(), and test_face_splits().

Here is the call graph for this function:

struct soup_s* bot2soup ( struct rt_bot_internal *  bot,
const struct bn_tol tol 
)

Definition at line 269 of file bottess.c.

References BU_ALLOC, bu_bomb(), bu_malloc(), soup_s::faces, faces_per_page, soup_s::magic, soup_s::maxfaces, soup_s::nfaces, s, soup_add_face(), and SOUP_MAGIC.

Referenced by evaluate().

Here is the call graph for this function:

void free_soup ( struct soup_s s)

Definition at line 293 of file bottess.c.

References bu_bomb(), bu_free(), and soup_s::faces.

Here is the call graph for this function:

union tree* invert ( union tree tree)

Definition at line 304 of file bottess.c.

References bu_log(), soup_s::faces, face_s::foo, INVERTED, soup_s::nfaces, OP_NMG_TESS, RT_CK_TREE, s, SOUP_CKMAG, tree::tree_nmgregion::td_r, tree::tr_d, and face_s::vert.

Referenced by evaluate().

Here is the call graph for this function:

void split_faces ( union tree left_tree,
union tree right_tree,
const struct bn_tol tol 
)

Definition at line 332 of file bottess.c.

References soup_s::faces, face_s::max, face_s::min, soup_s::nfaces, RT_CK_TREE, SOUP_CKMAG, split_face(), tree::tree_nmgregion::td_r, tree::tr_d, X, Y, and Z.

Referenced by evaluate().

Here is the call graph for this function:

union tree* compose ( union tree left_tree,
union tree right_tree,
unsigned long int  face_status1,
unsigned long int  face_status2,
unsigned long int  face_status3 
)

Definition at line 369 of file bottess.c.

References bu_log(), soup_s::faces, soup_s::nfaces, face_s::plane, RT_CK_TREE, tree::tree_nmgregion::td_r, tree::tr_d, V3ARGS, and face_s::vert.

Referenced by evaluate(), and test_compose().

Here is the call graph for this function:

union tree* evaluate ( union tree tr,
const struct rt_tess_tol ttol,
const struct bn_tol tol 
)
union tree* gcv_bottess_region_end ( struct db_tree_state tsp,
const struct db_full_path pathp,
union tree curtree,
void *  client_data 
)

Definition at line 484 of file bottess.c.

References BN_CK_TOL, bu_log(), evaluate(), OP_NOP, RT_CK_FULL_PATH, RT_CK_TESS_TOL, RT_CK_TREE, splitty, splitz, TREE_NULL, db_tree_state::ts_m, db_tree_state::ts_tol, and db_tree_state::ts_ttol.

Referenced by gcv_bottess().

Here is the call graph for this function:

union tree* gcv_bottess ( int  argc,
const char **  argv,
struct db_i dbip,
struct rt_tess_tol ttol 
)

Definition at line 524 of file bottess.c.

References bu_log(), db_walk_tree(), gcv_bottess_region_end(), nmg_booltree_leaf_tess(), rt_initial_tree_state, and db_tree_state::ts_ttol.

Here is the call graph for this function:

Variable Documentation

const int faces_per_page = 4096 / sizeof(struct face_s)

Definition at line 44 of file bottess.c.

Referenced by bot2soup(), and soup_add_face_precomputed().

long int splitz = 0

Definition at line 111 of file bottess.c.

Referenced by gcv_bottess_region_end(), and split_face().

long int splitty = 0

Definition at line 112 of file bottess.c.

Referenced by gcv_bottess_region_end(), and split_face().

long int lsplitz =0

Definition at line 480 of file bottess.c.

long int lsplitty =0

Definition at line 481 of file bottess.c.