BRL-CAD
Collaboration diagram for N-Manifold Geometry:

Files

file  nmg_bool.c
 
file  nmg_ck.c
 
file  nmg_class.c
 
file  nmg_copy.c
 
file  nmg_eval.c
 
file  nmg_extrude.c
 
file  nmg_fcut.c
 
file  nmg_fuse.c
 
file  nmg_index.c
 
file  nmg_info.c
 
file  nmg_inter.c
 
file  nmg_junk.c
 
file  nmg_manif.c
 
file  nmg_mesh.c
 
file  nmg_misc.c
 
file  nmg_mk.c
 
file  nmg_mod.c
 
file  nmg_plot.c
 
file  nmg_pr.c
 
file  nmg_pt_fu.c
 
file  nmg_rt_isect.c
 
file  nmg_rt_segs.c
 
file  nmg_tri.c
 
file  nmg_tri_mc.c
 
file  nmg_visit.c
 

Data Structures

struct  dangling_faceuse_state
 

Functions

size_t nmg_plot_open_edges (const uint32_t *magic_p, const char *prefix)
 
int nmg_has_dangling_faces (uint32_t *magic_p, const char *manifolds)
 
void nmg_show_each_loop (struct shell *s, char **classlist, int redraw, int fancy, const char *str)
 
void stash_shell (struct shell *s, char *file_name, char *title, const struct bn_tol *tol)
 
void nmg_kill_non_common_cracks (struct shell *sA, struct shell *sB)
 
void nmg_kill_anti_loops (struct shell *s)
 
void nmg_kill_wire_edges (struct shell *s)
 
struct nmgregion * nmg_do_bool (struct nmgregion *rA, struct nmgregion *rB, const int oper, const struct bn_tol *tol)
 
union treenmg_booltree_leaf_tess (struct db_tree_state *tsp, const struct db_full_path *pathp, struct rt_db_internal *ip, void *client_data)
 
union treenmg_booltree_leaf_tnurb (struct db_tree_state *tsp, const struct db_full_path *pathp, struct rt_db_internal *ip, void *client_data)
 
union treenmg_booltree_evaluate (register union tree *tp, const struct bn_tol *tol, struct resource *resp)
 
int nmg_boolean (union tree *tp, struct model *m, const struct bn_tol *tol, struct resource *resp)
 

Variables

int nmg_class_nothing_broken
 
int debug_file_count =0
 
int nmg_bool_eval_silent =0
 

Detailed Description

Function Documentation

size_t nmg_plot_open_edges ( const uint32_t *  magic_p,
const char *  prefix 
)

Find open edges, if any, in NMG object pointed to by magic_p and create a UNIX plot file containing these edges.

The prefix string will be appended to the front of the file name of the plot file.

Returns - 0 No open edges, no plot file created. !0 Has open edges, plot file created.

Definition at line 72 of file nmg_bool.c.

References bu_bomb(), BU_LIST_FIRST_MAGIC, BU_LIST_FOR, bu_log(), BU_PTBL_END, bu_ptbl_free(), BU_PTBL_GET, bu_ptbl_init(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_sprintf(), lu, NMG_CK_LOOPUSE(), NMG_EDGEUSE_MAGIC, nmg_face_tabulate(), nmg_radial_face_edge_in_shell(), and pdv_3line().

Here is the call graph for this function:

int nmg_has_dangling_faces ( uint32_t *  magic_p,
const char *  manifolds 
)

Argument is expected to be model, region, shell, or faceuse pointer.

Returns - 0 No dangling faces !0 Has dangling faces

Definition at line 177 of file nmg_bool.c.

References bu_calloc(), bu_free(), dangling_faceuse_state::count, dangling_faceuse_state::manifolds, nmg_find_model(), nmg_visit(), and dangling_faceuse_state::visited.

Here is the call graph for this function:

void nmg_show_each_loop ( struct shell *  s,
char **  classlist,
int  redraw,
int  fancy,
const char *  str 
)

Within a shell, show each loop as a separate display. Pause after displaying each one.

Note that in "non-fancy" mode, show_broken_eu() draws just the edge.

Definition at line 209 of file nmg_bool.c.

References BU_LIST_FIRST_MAGIC, BU_LIST_FOR, lu, NMG_CK_LOOPUSE(), NMG_CK_SHELL(), rt_g::NMG_debug, nmg_show_broken_classifier_stuff(), NMG_VERTEXUSE_MAGIC, and RTG.

Here is the call graph for this function:

void stash_shell ( struct shell *  s,
char *  file_name,
char *  title,
const struct bn_tol tol 
)

Definition at line 245 of file nmg_bool.c.

References BU_LIST_FIRST, BU_LIST_FOR, debug_file_count, nmg_dup_face(), nmg_km(), nmg_mm(), nmg_mrsv(), nmg_rebound(), and nmg_stash_model_to_file().

Here is the call graph for this function:

void nmg_kill_non_common_cracks ( struct shell *  sA,
struct shell *  sB 
)

Definition at line 272 of file nmg_bool.c.

References BU_LIST_FIRST, BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, BU_LIST_PNEXT_CIRC, bu_log(), lu, NMG_CK_LOOPUSE(), NMG_CK_SHELL(), rt_g::NMG_debug, NMG_EDGEUSE_MAGIC, nmg_find_v_in_shell(), nmg_keu(), nmg_kfu(), nmg_klu(), and RTG.

Here is the call graph for this function:

void nmg_kill_anti_loops ( struct shell *  s)

Look for same loop in opposite direction in shell "s", Kill them.

Definition at line 506 of file nmg_bool.c.

References BU_LIST_FIRST, BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_PNEXT_CIRC, BU_LIST_PPREV_CIRC, BU_PTBL_END, bu_ptbl_free(), BU_PTBL_GET, bu_ptbl_init(), bu_ptbl_ins(), bu_ptbl_rm(), eu1, eu2, lu, NMG_EDGEUSE_MAGIC, nmg_find_vertex_in_lu(), nmg_kfu(), nmg_klu(), and out.

Here is the call graph for this function:

void nmg_kill_wire_edges ( struct shell *  s)

Definition at line 602 of file nmg_bool.c.

References BU_LIST_FIRST, BU_LIST_NON_EMPTY, lu, nmg_keu(), and nmg_klu().

Here is the call graph for this function:

struct nmgregion* nmg_do_bool ( struct nmgregion *  rA,
struct nmgregion *  rB,
const int  oper,
const struct bn_tol tol 
)

BUG: we assume only one shell per region

Definition at line 1119 of file nmg_bool.c.

References bu_bomb(), BU_LIST_FIRST, BU_LIST_NON_EMPTY, NMG_CK_SHELL(), nmg_kr(), nmg_ks(), nmg_region_v_unique(), nmg_shell_is_empty(), and s.

Referenced by nmg_booltree_evaluate().

Here is the call graph for this function:

union tree* nmg_booltree_leaf_tess ( struct db_tree_state tsp,
const struct db_full_path pathp,
struct rt_db_internal ip,
void *  client_data 
)

Called from db_walk_tree() each time a tree leaf is encountered. The primitive solid, in external format, is provided in 'ep', and the type of that solid (e.g. ID_ELL) is in 'id'. The full tree state including the accumulated transformation matrix and the current tolerancing is in 'tsp', and the full path from root to leaf is in 'pathp'.

Import the solid, tessellate it into an NMG, stash a pointer to the tessellation in a new tree structure (union), and return a pointer to that.

Usually given as an argument to, and called from db_walk_tree().

This routine must be prepared to run in parallel.

Definition at line 1175 of file nmg_bool.c.

References BN_CK_TOL, bu_log(), bu_strdup, directory::d_namep, DB_FULL_PATH_CUR_DIR, DEBUG_TREEWALK, rt_functab::ft_tessellate, rt_db_internal::idb_meth, rt_g::NMG_debug, nmg_mm(), nmg_vshell(), OP_NMG_TESS, RT_CK_DB_INTERNAL, RT_CK_DIR, RT_CK_FULL_PATH, RT_CK_RESOURCE, RT_CK_TESS_TOL, RT_G_DEBUG, RT_GET_TREE, RTG, tree::tree_nmgregion::td_name, tree::tree_nmgregion::td_r, tree::tr_d, TREE_NULL, db_tree_state::ts_m, db_tree_state::ts_resp, db_tree_state::ts_tol, and db_tree_state::ts_ttol.

Referenced by _ged_drawtrees(), gcv_bottess(), ged_bev(), ged_facetize(), and leaf_tess1().

Here is the call graph for this function:

union tree* nmg_booltree_leaf_tnurb ( struct db_tree_state tsp,
const struct db_full_path pathp,
struct rt_db_internal ip,
void *  client_data 
)

Called from db_walk_tree() each time a tree leaf is encountered. The primitive solid, in external format, is provided in 'ep', and the type of that solid (e.g. ID_ELL) is in 'id'. The full tree state including the accumulated transformation matrix and the current tolerancing is in 'tsp', and the full path from root to leaf is in 'pathp'.

Import the solid, convert it into an NMG using t-NURBS, stash a pointer in a new tree structure (union), and return a pointer to that.

Usually given as an argument to, and called from db_walk_tree().

This routine must be prepared to run in parallel.

Definition at line 1241 of file nmg_bool.c.

References BN_CK_TOL, bu_log(), bu_strdup, directory::d_namep, DB_FULL_PATH_CUR_DIR, DEBUG_TREEWALK, rt_functab::ft_tnurb, rt_db_internal::idb_meth, rt_g::NMG_debug, nmg_vshell(), OP_NMG_TESS, RT_CK_DB_INTERNAL, RT_CK_DIR, RT_CK_FULL_PATH, RT_CK_RESOURCE, RT_CK_TESS_TOL, RT_G_DEBUG, RT_GET_TREE, RTG, tree::tree_nmgregion::td_name, tree::tree_nmgregion::td_r, tree::tr_d, TREE_NULL, db_tree_state::ts_m, db_tree_state::ts_resp, db_tree_state::ts_tol, and db_tree_state::ts_ttol.

Referenced by _ged_drawtrees(), and ged_facetize().

Here is the call graph for this function:

union tree* nmg_booltree_evaluate ( register union tree tp,
const struct bn_tol tol,
struct resource resp 
)

Given a tree of leaf nodes tessellated earlier by nmg_booltree_leaf_tess(), use recursion to do a depth-first traversal of the tree, evaluating each pair of boolean operations and reducing that result to a single nmgregion.

Usually called from a do_region_end() handler from db_walk_tree(). For an example of several, see mged/dodraw.c.

Returns an OP_NMG_TESS union tree node, which will contain the resulting region and its name, as a dynamic string. The caller is responsible for releasing the string, and the node, by calling db_free_tree() on the node.

It is essential that the caller call nmg_model_fuse() before calling this subroutine.

Returns NULL if there is no geometry to return.

Typical calls will be of this form: (void)nmg_model_fuse(m, tol); curtree = nmg_booltree_evaluate(curtree, tol);

Definition at line 1307 of file nmg_bool.c.

References BN_CK_TOL, bu_bomb(), bu_calloc(), BU_LIST_FIRST, bu_log(), db_free_tree(), nmg_ck_closed_region(), rt_g::NMG_debug, nmg_do_bool(), nmg_merge_models(), nmg_pr_s_briefly(), nmg_r_radial_check(), nmg_vshell(), OP_INTERSECT, OP_NMG_TESS, OP_NOP, OP_SUBTRACT, OP_UNION, rem, RT_CK_RESOURCE, RT_CK_TREE, RTG, tree::tree_node::tb_left, tree::tree_node::tb_regionp, tree::tree_node::tb_right, tree::tree_nmgregion::td_name, tree::tree_nmgregion::td_r, tree::tr_b, tree::tr_d, and TREE_NULL.

Referenced by gcv_region_end(), and nmg_boolean().

Here is the call graph for this function:

int nmg_boolean ( union tree tp,
struct model *  m,
const struct bn_tol tol,
struct resource resp 
)

This is the main application interface to the NMG Boolean Evaluator.

This routine has the opportunity to do "once only" operations before and after the boolean tree is walked.

Returns - 0 Boolean went OK. Result region is in tp->tr_d.td_r !0 Boolean produced null result.

The caller is responsible for freeing 'tp' in either case, typically with db_free_tree(tp);

Definition at line 1523 of file nmg_bool.c.

References BN_CK_TOL, bu_bomb(), bu_log(), nmg_booltree_evaluate(), rt_g::NMG_debug, nmg_merge_models(), OP_NMG_TESS, out, RT_CK_RESOURCE, RT_CK_TREE, rt_pr_tree(), RTG, tree::tree_nmgregion::td_r, tree::tr_d, and TREE_NULL.

Referenced by ged_bev(), and ged_facetize().

Here is the call graph for this function:

Variable Documentation

int nmg_class_nothing_broken

Definition at line 1443 of file nmg_plot.c.

int debug_file_count =0

Definition at line 57 of file nmg_bool.c.

Referenced by stash_shell().

int nmg_bool_eval_silent =0

Definition at line 1281 of file nmg_bool.c.