nmg_fuse.c File Reference

#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <strings.h>
#include <math.h>
#include "machine.h"
#include "vmath.h"
#include "nmg.h"
#include "raytrace.h"
#include "nurb.h"
#include "./debug.h"

Include dependency graph for nmg_fuse.c:

Go to the source code of this file.

Data Structures

struct  pt_list

Defines

#define CHECK_NUMBER   20
#define TOL_MULTIPLES   1.0

Functions

void nmg_split_trim (const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, fastf_t t, struct pt_list *pt0, struct pt_list *pt1, const struct bn_tol *tol)
int nmg_is_common_bigloop (const struct face *f1, const struct face *f2)
void nmg_region_v_unique (struct nmgregion *r1, const struct bn_tol *tol)
int nmg_ptbl_vfuse (struct bu_ptbl *t, const struct bn_tol *tol)
int nmg_region_both_vfuse (struct bu_ptbl *t1, struct bu_ptbl *t2, const struct bn_tol *tol)
int nmg_model_vertex_fuse (struct model *m, const struct bn_tol *tol)
int nmg_cnurb_is_linear (const struct edge_g_cnurb *cnrb)
int nmg_snurb_is_planar (const struct face_g_snurb *srf, const struct bn_tol *tol)
void nmg_eval_linear_trim_curve (const struct face_g_snurb *snrb, const fastf_t *uvw, fastf_t *xyz)
void nmg_eval_trim_curve (const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t t, fastf_t *xyz)
void nmg_eval_trim_to_tol (const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t t0, const fastf_t t1, struct bu_list *head, const struct bn_tol *tol)
void nmg_split_linear_trim (const struct face_g_snurb *snrb, const fastf_t *uvw1, const fastf_t *uvw, const fastf_t *uvw2, struct pt_list *pt0, struct pt_list *pt1, const struct bn_tol *tol)
void nmg_eval_linear_trim_to_tol (const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t *uvw1, const fastf_t *uvw2, struct bu_list *head, const struct bn_tol *tol)
int nmg_cnurb_lseg_coincident (const struct edgeuse *eu1, const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const fastf_t *pt1, const fastf_t *pt2, const struct bn_tol *tol)
int nmg_cnurb_is_on_crv (const struct edgeuse *eu, const struct edge_g_cnurb *cnrb, const struct face_g_snurb *snrb, const struct bu_list *head, const struct bn_tol *tol)
int nmg_model_edge_fuse (struct model *m, const struct bn_tol *tol)
int nmg_model_edge_g_fuse (struct model *m, const struct bn_tol *tol)
int nmg_ck_fu_verts (struct faceuse *fu1, struct face *f2, const struct bn_tol *tol)
int nmg_ck_fg_verts (struct faceuse *fu1, struct face *f2, const struct bn_tol *tol)
int nmg_two_face_fuse (struct face *f1, struct face *f2, const struct bn_tol *tol)
int nmg_model_face_fuse (struct model *m, const struct bn_tol *tol)
int nmg_break_all_es_on_v (long int *magic_p, struct vertex *v, const struct bn_tol *tol)
int nmg_model_break_e_on_v (struct model *m, const struct bn_tol *tol)
int nmg_model_fuse (struct model *m, const struct bn_tol *tol)
void nmg_radial_sorted_list_insert (struct bu_list *hd, struct nmg_radial *rad)
void nmg_radial_verify_pointers (const struct bu_list *hd, const struct bn_tol *tol)
void nmg_radial_verify_monotone (const struct bu_list *hd, const struct bn_tol *tol)
void nmg_insure_radial_list_is_increasing (struct bu_list *hd, fastf_t amin, fastf_t amax)
void nmg_radial_build_list (struct bu_list *hd, struct bu_ptbl *shell_tbl, int existing, struct edgeuse *eu, const fastf_t *xvec, const fastf_t *yvec, const fastf_t *zvec, const struct bn_tol *tol)
void nmg_radial_merge_lists (struct bu_list *dest, struct bu_list *src, const struct bn_tol *tol)
int nmg_is_crack_outie (const struct edgeuse *eu, const struct bn_tol *tol)
nmg_radialnmg_find_radial_eu (const struct bu_list *hd, const struct edgeuse *eu)
const struct edgeusenmg_find_next_use_of_2e_in_lu (const struct edgeuse *eu, const struct edge *e1, const struct edge *e2)
void nmg_radial_mark_cracks (struct bu_list *hd, const struct edge *e1, const struct edge *e2, const struct bn_tol *tol)
nmg_radialnmg_radial_find_an_original (const struct bu_list *hd, const struct shell *s, const struct bn_tol *tol)
int nmg_radial_mark_flips (struct bu_list *hd, const struct shell *s, const struct bn_tol *tol)
int nmg_radial_check_parity (const struct bu_list *hd, const struct bu_ptbl *shells, const struct bn_tol *tol)
void nmg_radial_implement_decisions (struct bu_list *hd, const struct bn_tol *tol, struct edgeuse *eu1, fastf_t *xvec, fastf_t *yvec, fastf_t *zvec)
void nmg_pr_radial (const char *title, const struct nmg_radial *rad)
void nmg_pr_radial_list (const struct bu_list *hd, const struct bn_tol *tol)
void nmg_do_radial_flips (struct bu_list *hd)
void nmg_do_radial_join (struct bu_list *hd, struct edgeuse *eu1ref, fastf_t *xvec, fastf_t *yvec, fastf_t *zvec, const struct bn_tol *tol)
void nmg_radial_join_eu_NEW (struct edgeuse *eu1, struct edgeuse *eu2, const struct bn_tol *tol)
void nmg_radial_exchange_marked (struct bu_list *hd, const struct bn_tol *tol)
void nmg_s_radial_harmonize (struct shell *s, const struct bn_tol *tol)
int nmg_eu_radial_check (const struct edgeuse *eu, const struct shell *s, const struct bn_tol *tol)
void nmg_s_radial_check (struct shell *s, const struct bn_tol *tol)
void nmg_r_radial_check (const struct nmgregion *r, const struct bn_tol *tol)

Variables

int debug_file_count


Detailed Description

Routines to "fuse" entities together that are geometrically identical (within tolerance) into entities that share underlying geometry structures, so that the relationship is explicit.

Authors - Michael John Muuss John R Anderson

Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5068 USA

Definition in file nmg_fuse.c.


Define Documentation

#define CHECK_NUMBER   20
 

Definition at line 834 of file nmg_fuse.c.

Referenced by nmg_cnurb_lseg_coincident().

#define TOL_MULTIPLES   1.0
 

Definition at line 1382 of file nmg_fuse.c.

Referenced by nmg_ck_fu_verts().


Function Documentation

void nmg_split_trim const struct edge_g_cnurb cnrb,
const struct face_g_snurb snrb,
fastf_t  t,
struct pt_list pt0,
struct pt_list pt1,
const struct bn_tol tol
 

Definition at line 642 of file nmg_fuse.c.

References BN_CK_TOL, BU_LIST_INSERT, bu_log(), bu_malloc(), DEBUG_MESH, bn_tol::dist_sq, pt_list::l, MAGSQ, NMG_CK_EDGE_G_CNURB, NMG_CK_FACE_G_SNURB, nmg_eval_trim_curve(), rt_bomb(), pt_list::t, VSUB2, and pt_list::xyz.

Referenced by nmg_eval_trim_to_tol().

Here is the call graph for this function:

void nmg_eval_linear_trim_curve const struct face_g_snurb snrb,
const fastf_t uvw,
fastf_t xyz
 

Definition at line 565 of file nmg_fuse.c.

References NMG_CK_FACE_G_SNURB, RT_NURB_EXTRACT_COORDS, RT_NURB_IS_PT_RATIONAL, rt_nurb_s_eval(), VMOVE, and VSCALE.

Here is the call graph for this function:

void nmg_eval_trim_curve const struct edge_g_cnurb cnrb,
const struct face_g_snurb snrb,
const fastf_t  t,
fastf_t xyz
 

Definition at line 592 of file nmg_fuse.c.

References bu_log(), DEBUG_MESH, NMG_CK_EDGE_G_CNURB, NMG_CK_FACE_G_SNURB, edge_g_cnurb::pt_type, rt_nurb_c_eval(), RT_NURB_EXTRACT_COORDS, RT_NURB_IS_PT_RATIONAL, rt_nurb_s_eval(), V3ARGS, VMOVE, and VSCALE.

Here is the call graph for this function:

void nmg_split_linear_trim const struct face_g_snurb snrb,
const fastf_t uvw1,
const fastf_t uvw,
const fastf_t uvw2,
struct pt_list pt0,
struct pt_list pt1,
const struct bn_tol tol
 

Definition at line 734 of file nmg_fuse.c.

References BN_CK_TOL, BU_LIST_INSERT, bu_log(), bu_malloc(), DEBUG_MESH, bn_tol::dist_sq, pt_list::l, MAGSQ, NMG_CK_FACE_G_SNURB, nmg_eval_linear_trim_curve(), pt_list::t, V3ARGS, VBLEND2, VSUB2, and pt_list::xyz.

Referenced by nmg_eval_linear_trim_to_tol().

Here is the call graph for this function:

void nmg_eval_linear_trim_to_tol const struct edge_g_cnurb cnrb,
const struct face_g_snurb snrb,
const fastf_t uvw1,
const fastf_t uvw2,
struct bu_list head,
const struct bn_tol tol
 

Definition at line 797 of file nmg_fuse.c.

References BN_CK_TOL, BU_LIST_INSERT, bu_log(), bu_malloc(), DEBUG_MESH, head, pt_list::l, NMG_CK_EDGE_G_CNURB, NMG_CK_FACE_G_SNURB, nmg_eval_linear_trim_curve(), nmg_split_linear_trim(), pt_list::t, V3ARGS, VBLEND2, and pt_list::xyz.

Here is the call graph for this function:

int nmg_cnurb_lseg_coincident const struct edgeuse eu1,
const struct edge_g_cnurb cnrb,
const struct face_g_snurb snrb,
const fastf_t pt1,
const fastf_t pt2,
const struct bn_tol tol
 

N M G _ C N U R B _ L S E G _ C O I N C I D E N T

Checks if CNURB is coincident with line segment from pt1 to pt2 by calculating a number of points along the CNURB and checking if they lie on the line between pt1 and pt2 (within tolerance). NOTE: eu1 must be the EU referencing cnrb!!!!

Returns: 0 - not coincident 1 - coincident

Definition at line 848 of file nmg_fuse.c.

References vertexuse::a, BN_CK_TOL, bn_dist_pt3_lseg3(), bu_log(), CHECK_NUMBER, vertexuse::cnurb_p, edgeuse::cnurb_p, DEBUG_MESH, edgeuse::eumate_p, edgeuse::g, vertexuse::magic_p, NMG_CK_EDGE_G_CNURB, NMG_CK_EDGEUSE, NMG_CK_FACE_G_SNURB, NMG_CK_VERTEXUSE, NMG_CK_VERTEXUSE_A_CNURB, nmg_eval_linear_trim_curve(), NMG_VERTEXUSE_A_CNURB_MAGIC, edge_g_cnurb::order, vertexuse_a_cnurb::param, rt_bomb(), pt_list::t, V3ARGS, VBLEND2, and edgeuse::vu_p.

Here is the call graph for this function:

int nmg_break_all_es_on_v long int *  magic_p,
struct vertex v,
const struct bn_tol tol
 

Definition at line 1746 of file nmg_fuse.c.

References BN_CK_TOL, bn_isect_pt_lseg(), bu_identify_magic(), BU_LIST_PNEXT_CIRC, BU_LIST_PPREV_CIRC, bu_log(), BU_PTBL_END, BU_PTBL_GET, vertex_g::coord, DEBUG_BOOL, edgeuse::eumate_p, NMG_CK_EDGEUSE, NMG_CK_VERTEX, nmg_ebreak(), NMG_EDGE_G_CNURB_MAGIC, nmg_edgeuse_tabulate(), rt_bomb(), vertexuse::v_p, vertex::vg_p, void(), and edgeuse::vu_p.

Here is the call graph for this function:

void nmg_radial_build_list struct bu_list hd,
struct bu_ptbl shell_tbl,
int  existing,
struct edgeuse eu,
const fastf_t xvec,
const fastf_t yvec,
const fastf_t zvec,
const struct bn_tol tol
 

N M G _ R A D I A L _ B U I L D _ L I S T

The coordinate system is expected to have been chosen in such a way that the radial list of faces around this edge are circularly increasing (CCW) in their angle. Put them in the list in exactly the order they occur around the edge. Then, at the end, move the list head to lie between the maximum and minimum angles, so that the list head is crossed as the angle goes around through zero. Now the list is monotone increasing.

The edgeuse's radial pointer takes us in the CCW direction.

If the list contains nmg_radial structures r1, r2, r3, r4, then going CCW around the edge we will encounter:

(from i-1) (from i+1) r1->eu->eumate_p r4->eu->radial_p r2->eu->eumate_p->radial_p->eumate_p r1->eu r4->eu->radial_p->eumate_p r2->eu->eumate_p->radial_p r2->eu->eumate_p r1->eu->radial_p r3->eu->eumate_p->radial_p->eumate_p r2->eu r1->eu->radial_p->eumate_p r3->eu->eumate_p->radial_p r3->eu->eumate_p r2->eu->radial_p r4->eu->eumate_p->radial_p->eumate_p r3->eu r2->eu->radial_p->eumate_p r4->eu->eumate_p->radial_p r4->eu->eumate_p r3->eu->radial_p r1->eu->eumate_p->radial_p->eumate_p r4->eu r3->eu->radial_p->eumate_p r1->eu->eumate_p->radial_p

Definition at line 2213 of file nmg_fuse.c.

References nmg_radial::ang, BN_CK_TOL, bn_pi, BU_CK_LIST_HEAD, BU_CK_PTBL, BU_GETSTRUCT, BU_LIST_INSERT, bu_log(), bu_ptbl_ins_unique(), DEBUG_BASIC, DEBUG_MESH_EU, nmg_radial::eu, edgeuse::eumate_p, nmg_radial::existing_flag, nmg_radial::fu, nmg_radial::is_crack, nmg_radial::is_outie, shell::l, nmg_radial::l, bu_list::magic, nmg_radial::needs_flip, NMG_CK_EDGEUSE, nmg_find_fu_of_eu(), nmg_find_s_of_eu(), nmg_measure_fu_angle(), NMG_RADIAL_MAGIC, NULL, edgeuse::radial_p, and nmg_radial::s.

Here is the call graph for this function:

void nmg_radial_implement_decisions struct bu_list hd,
const struct bn_tol tol,
struct edgeuse eu1,
fastf_t xvec,
fastf_t yvec,
fastf_t zvec
 

N M G _ R A D I A L _ I M P L E M E N T _ D E C I S I O N S

For all non-original edgeuses in the list, place them in the proper place around the destination edge.

Definition at line 2949 of file nmg_fuse.c.

References BN_CK_TOL, BU_CK_LIST_HEAD, BU_LIST_FOR, BU_LIST_PPREV_CIRC, bu_log(), DEBUG_BASIC, DEBUG_MESH_EU, nmg_radial::eu, edgeuse::eumate_p, nmg_radial::existing_flag, nmg_radial::fu, nmg_radial::needs_flip, nmg_find_fu_of_eu(), nmg_je(), nmg_pr_fu_around_eu_vecs(), and nmg_pr_radial().

Here is the call graph for this function:

void nmg_do_radial_join struct bu_list hd,
struct edgeuse eu1ref,
fastf_t xvec,
fastf_t yvec,
fastf_t zvec,
const struct bn_tol tol
 

N M G _ D O _ R A D I A L _ J O I N

Perform radial join of edges in list "hd" based on direction with respect to "eu1ref"

Definition at line 3182 of file nmg_fuse.c.

References BN_CK_TOL, BU_CK_LIST_HEAD, BU_LIST_FOR, BU_LIST_PPREV_CIRC, bu_log(), vertex_g::coord, DEBUG_MESH_EU, nmg_radial::eu, edgeuse::eumate_p, nmg_radial::existing_flag, nmg_radial::fu, NMG_CK_EDGEUSE, nmg_do_radial_flips(), nmg_je(), nmg_pr_fu_around_eu_vecs(), nmg_pr_radial(), nmg_pr_radial_list(), top(), V3ARGS, vertexuse::v_p, VDOT, vertex::vg_p, VSUB2, and edgeuse::vu_p.

Here is the call graph for this function:


Variable Documentation

int debug_file_count
 

Definition at line 67 of file nmg_bool.c.

Referenced by nmg_eu_radial_check(), and stash_shell().


Generated on Mon Sep 18 01:25:07 2006 for BRL-CAD by  doxygen 1.4.6