BRL-CAD
edge.h File Reference
#include "common.h"
#include "vmath.h"
#include "bu/list.h"
#include "nmg/defines.h"
#include "nmg/topology.h"
Include dependency graph for edge.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NMG_CK_EDGE(_p)   NMG_CKMAG(_p, NMG_EDGE_MAGIC, "edge")
 
#define NMG_CK_EDGE_G_LSEG(_p)   NMG_CKMAG(_p, NMG_EDGE_G_LSEG_MAGIC, "edge_g_lseg")
 
#define NMG_CK_EDGEUSE(_p)   NMG_CKMAG(_p, NMG_EDGEUSE_MAGIC, "edgeuse")
 
#define GET_EDGE(p, m)   {NMG_GETSTRUCT(p, edge); NMG_INCR_INDEX(p, m);}
 
#define GET_EDGE_G_LSEG(p, m)   {NMG_GETSTRUCT(p, edge_g_lseg); NMG_INCR_INDEX(p, m);}
 
#define GET_EDGE_G_CNURB(p, m)   {NMG_GETSTRUCT(p, edge_g_cnurb); NMG_INCR_INDEX(p, m);}
 
#define GET_EDGEUSE(p, m)   {NMG_GETSTRUCT(p, edgeuse); NMG_INCR_INDEX(p, m);}
 
#define FREE_EDGE(p)   NMG_FREESTRUCT(p, edge)
 
#define FREE_EDGE_G_LSEG(p)   NMG_FREESTRUCT(p, edge_g_lseg)
 
#define FREE_EDGE_G_CNURB(p)   NMG_FREESTRUCT(p, edge_g_cnurb)
 
#define FREE_EDGEUSE(p)   NMG_FREESTRUCT(p, edgeuse)
 
#define nmg_mev(_v, _u)   nmg_me((_v), (struct vertex *)NULL, (_u))
 
#define NMG_ARE_EUS_ADJACENT(_eu1, _eu2)
 
#define EDGESADJ(_e1, _e2)   NMG_ARE_EUS_ADJACENT(_e1, _e2)
 

Functions

void nmg_edge_g (struct edgeuse *eu)
 Compute the equation of the line formed by the endpoints of the edge. More...
 
int nmg_use_edge_g (struct edgeuse *eu, uint32_t *magic_p)
 Associate edgeuse 'eu' with the edge geometry structure identified by 'magic_p', where magic_p is the pointer to the magic entry of an edge_g_lseg. More...
 
int nmg_demote_eu (struct edgeuse *eu)
 Demote a wire edge into a pair of self-loop vertices. More...
 
void nmg_je (struct edgeuse *eudst, struct edgeuse *eusrc)
 Move a pair of edgeuses onto a single edge (glue edgeuse). More...
 
void nmg_unglueedge (struct edgeuse *eu)
 If edgeuse is part of a shared edge (more than one pair of edgeuses on the edge), it and its mate are "unglued" from the edge, and associated with a new edge structure. More...
 
void nmg_jeg (struct edge_g_lseg *dest_eg, struct edge_g_lseg *src_eg)
 Join two edge geometries. More...
 
struct edgeusenmg_me (struct vertex *v1, struct vertex *v2, struct shell *s)
 Make wire edge. More...
 
struct edgeusenmg_meonvu (struct vertexuse *vu)
 Make an edge on vertexuse. More...
 
int nmg_keu (struct edgeuse *eu)
 Delete an edgeuse & its mate from a shell or loop. More...
 
struct edgeusenmg_find_matching_eu_in_s (const struct edgeuse *eu1, const struct shell *s2)
 If shell s2 has an edge that connects the same vertices as eu1 connects, return the matching edgeuse in s2. More...
 
struct edgeusenmg_findeu (const struct vertex *v1, const struct vertex *v2, const struct shell *s, const struct edgeuse *eup, int dangling_only)
 Find an edgeuse in a shell between a given pair of vertex structs. More...
 
struct edgeusenmg_find_eu_in_face (const struct vertex *v1, const struct vertex *v2, const struct faceuse *fu, const struct edgeuse *eup, int dangling_only)
 An analog to nmg_findeu(), only restricted to searching a faceuse, rather than to a whole shell. More...
 
struct edgeusenmg_find_e (const struct vertex *v1, const struct vertex *v2, const struct shell *s, const struct edge *ep)
 Find an edge between a given pair of vertices. More...
 
struct edgeusenmg_find_eu_of_vu (const struct vertexuse *vu)
 Return a pointer to the edgeuse which is the parent of this vertexuse. More...
 
struct edgeusenmg_find_eu_with_vu_in_lu (const struct loopuse *lu, const struct vertexuse *vu)
 Find an edgeuse starting at a given vertexuse within a loopuse. More...
 
const struct edgeusenmg_faceradial (const struct edgeuse *eu)
 Looking radially around an edge, find another edge in the same face as the current edge. (this could be the mate to the current edge) More...
 
const struct edgeusenmg_radial_face_edge_in_shell (const struct edgeuse *eu)
 Looking radially around an edge, find another edge which is a part of a face in the same shell. More...
 
const struct edgeusenmg_find_edge_between_2fu (const struct faceuse *fu1, const struct faceuse *fu2, struct bu_list *vlfree, const struct bn_tol *tol)
 Perform a topology search to determine if two faces (specified by their faceuses) share an edge in common. If so, return an edgeuse in fu1 of that edge. More...
 
struct edgenmg_find_e_nearest_pt2 (uint32_t *magic_p, const point_t pt2, const mat_t mat, struct bu_list *vlfree, const struct bn_tol *tol)
 A geometric search routine to find the edge that is nearest to the given point, when all edges are projected into 2D using the matrix 'mat'. Useful for finding the edge nearest a mouse click, for example. More...
 
void nmg_eu_2vecs_perp (vect_t xvec, vect_t yvec, vect_t zvec, const struct edgeuse *eu, const struct bn_tol *tol)
 Given an edgeuse, return two arbitrary unit-length vectors which are perpendicular to each other and to the edgeuse, such that they can be considered the +X and +Y axis, and the edgeuse is +Z. That is, X cross Y = Z. More...
 
int nmg_find_eu_leftvec (vect_t left, const struct edgeuse *eu)
 Given an edgeuse, if it is part of a faceuse, return the inward pointing "left" vector which points into the interior of this loop, and lies in the plane of the face. The left vector is unitized. More...
 
int nmg_find_eu_left_non_unit (vect_t left, const struct edgeuse *eu)
 Given an edgeuse, if it is part of a faceuse, return the inward pointing "left" vector which points into the interior of this loop, and lies in the plane of the face. The left vector is not unitized. More...
 
struct edgeusenmg_find_ot_same_eu_of_e (const struct edge *e)
 If there is an edgeuse of an OT_SAME faceuse on this edge, return it. Only return a wire edgeuse if that is all there is. More...
 
int nmg_is_vertex_in_edgelist (const struct vertex *v, const struct bu_list *hd)
 Check if a vertex is in use within a list of edges. More...
 
int nmg_is_edge_in_edgelist (const struct edge *e, const struct bu_list *hd)
 Check if edge e is present within a list of edges. More...
 
void nmg_edgeuse_tabulate (struct bu_ptbl *tab, const uint32_t *magic_p, struct bu_list *vlfree)
 Build the set of pointers to all edgeuse structures in an NMG model that are "below" the data structure pointed to by magic_p, where magic_p is a pointer to the magic entry of any NMG data structure in the model. More...
 
void nmg_edge_tabulate (struct bu_ptbl *tab, const uint32_t *magic_p, struct bu_list *vlfree)
 Build the set of pointers to all edge structures in an NMG model that are "below" the data structure pointed to by magic_p, where magic_p is a pointer to the magic entry of any NMG data structure in the model. More...
 
void nmg_edge_g_tabulate (struct bu_ptbl *tab, const uint32_t *magic_p, struct bu_list *vlfree)
 Build the set of pointers to all edge geometry structures in an NMG model that are "below" the data structure pointed to by magic_p, where magic_p is a pointer to the magic entry of any NMG data structure in the model. More...
 
void nmg_edgeuse_with_eg_tabulate (struct bu_ptbl *tab, const struct edge_g_lseg *eg)
 Build an bu_ptbl list which cites every edgeuse pointer that uses edge geometry "eg". More...
 
void nmg_edgeuse_on_line_tabulate (struct bu_ptbl *tab, const uint32_t *magic_p, const point_t pt, const vect_t dir, struct bu_list *vlfree, const struct bn_tol *tol)
 Given a pointer to any nmg data structure, build an bu_ptbl list which cites every edgeuse pointer from there on "down" in the model that has both vertices within tolerance of the given line. More...
 
void nmg_e_and_v_tabulate (struct bu_ptbl *eutab, struct bu_ptbl *vtab, const uint32_t *magic_p, struct bu_list *vlfree)
 Build lists of all edges (represented by one edgeuse on that edge) and all vertices found underneath the NMG entity indicated by magic_p. More...
 
int nmg_2edgeuse_g_coincident (const struct edgeuse *eu1, const struct edgeuse *eu2, const struct bn_tol *tol)
 
int nmg_mark_edges_real (const uint32_t *magic_p, struct bu_list *vlfree)
 Sets the "is_real" flag on all edges at or below the pointer passed. Returns the number of flags set. More...
 
struct edgeusenmg_pop_eu (struct bu_ptbl *stack)
 Convenience wrapper to retrieve and remove the last edgeuse element from the stack bu_ptbl. More...
 
int nmg_move_edge_thru_pnt (struct edgeuse *mv_eu, const point_t pt, const struct bn_tol *tol)
 Moves indicated edgeuse (mv_eu) so that it passes thru the given point (pt). The direction of the edgeuse is not changed, so new edgeuse is parallel to the original. More...
 
int nmg_break_edge_at_verts (struct edge *e, struct bu_ptbl *verts, const struct bn_tol *tol)
 Split an edge into multiple edges at specified vertices if they are within tolerance distance. More...
 
int nmg_break_edges (uint32_t *magic_p, struct bu_list *vlfree, const struct bn_tol *tol)
 Apply nmg_break_edge_at_verts() to all edge/vertex combinations present in the NMG model below the NMG element with the magic number pointed to by magic_p. More...
 
int nmg_edge_fuse (const uint32_t *magic_p, struct bu_list *vlfree, const struct bn_tol *tol)
 Fuse vertices and edges according to tol. More...
 
int nmg_edge_g_fuse (const uint32_t *magic_p, struct bu_list *vlfree, const struct bn_tol *tol)
 Fuse edge_g structs. More...
 
struct edge_g_lsegnmg_pick_best_edge_g (struct edgeuse *eu1, struct edgeuse *eu2, const struct bn_tol *tol)
 Given two edgeuses with different edge geometry but running between the same two vertices, select the proper edge geometry to associate with. More...
 
int nmg_eu_is_part_of_crack (const struct edgeuse *eu)
 Check if eu is part of a loop but is not correctly connected topologically to other edges in the loop. More...
 
void nmg_radial_join_eu (struct edgeuse *eu1, struct edgeuse *eu2, const struct bn_tol *tol)
 Make all the edgeuses around eu2's edge to refer to eu1's edge, taking care to organize them into the proper angular orientation, so that the attached faces are correctly arranged radially around the edge. More...
 
int nmg_break_all_es_on_v (uint32_t *magic_p, struct vertex *v, struct bu_list *vlfree, const struct bn_tol *tol)
 TODO - document... More...
 
int nmg_break_e_on_v (const uint32_t *magic_p, struct bu_list *vlfree, const struct bn_tol *tol)
 As the first step in evaluating a boolean formula, before starting to do face/face intersections, compare every edge in the model with every vertex in the model. More...
 
int nmg_wedge_class (int ass, double a, double b)
 Determine if the given wedge is entirely to the left or right of the ray, or if it crosses. More...