BRL-CAD

Routines for working with NMG Faces and Face Uses. More...

Collaboration diagram for Face:

Files

file  face.h
 

Macros

#define NMG_CK_FACE(_p)   NMG_CKMAG(_p, NMG_FACE_MAGIC, "face")
 
#define NMG_CK_FACE_G_PLANE(_p)   NMG_CKMAG(_p, NMG_FACE_G_PLANE_MAGIC, "face_g_plane")
 
#define NMG_CK_FACE_G_SNURB(_p)   NMG_CKMAG(_p, NMG_FACE_G_SNURB_MAGIC, "face_g_snurb")
 
#define NMG_CK_FACE_G_EITHER(_p)   NMG_CK2MAG(_p, NMG_FACE_G_PLANE_MAGIC, NMG_FACE_G_SNURB_MAGIC, "face_g_plane|face_g_snurb")
 
#define NMG_CK_FACEUSE(_p)   NMG_CKMAG(_p, NMG_FACEUSE_MAGIC, "faceuse")
 
#define NMG_GET_FU_PLANE(_N, _fu)
 
#define NMG_GET_FU_PLANE(_N, _fu)
 
#define NMG_GET_FU_NORMAL(_N, _fu)
 
#define GET_FACE(p, m)   {NMG_GETSTRUCT(p, face); NMG_INCR_INDEX(p, m);}
 
#define GET_FACE_G_PLANE(p, m)   {NMG_GETSTRUCT(p, face_g_plane); NMG_INCR_INDEX(p, m);}
 
#define GET_FACE_G_SNURB(p, m)   {NMG_GETSTRUCT(p, face_g_snurb); NMG_INCR_INDEX(p, m);}
 
#define GET_FACEUSE(p, m)   {NMG_GETSTRUCT(p, faceuse); NMG_INCR_INDEX(p, m);}
 
#define FREE_FACE(p)   NMG_FREESTRUCT(p, face)
 
#define FREE_FACE_G_PLANE(p)   NMG_FREESTRUCT(p, face_g_plane)
 
#define FREE_FACE_G_SNURB(p)   NMG_FREESTRUCT(p, face_g_snurb)
 
#define FREE_FACEUSE(p)   NMG_FREESTRUCT(p, faceuse)
 

Functions

void nmg_face_g (struct faceuse *fu, const plane_t p)
 
void nmg_face_new_g (struct faceuse *fu, const plane_t pl)
 
void nmg_face_bb (struct face *f, const struct bn_tol *tol)
 
void nmg_jfg (struct face *f1, struct face *f2)
 
struct faceusenmg_find_fu_of_eu (const struct edgeuse *eu)
 
struct faceusenmg_find_fu_of_lu (const struct loopuse *lu)
 
struct faceusenmg_find_fu_of_vu (const struct vertexuse *vu)
 
struct faceusenmg_find_fu_with_fg_in_s (const struct shell *s1, const struct faceuse *fu2)
 
double nmg_measure_fu_angle (const struct edgeuse *eu, const vect_t xvec, const vect_t yvec, const vect_t zvec)
 
struct faceusenmg_mf (struct loopuse *lu1)
 
int nmg_kfu (struct faceuse *fu1)
 
struct faceusenmg_cmface (struct shell *s, struct vertex **vt[], int n)
 
struct faceusenmg_cface (struct shell *s, struct vertex **vt, int n)
 
struct faceusenmg_add_loop_to_face (struct shell *s, struct faceuse *fu, struct vertex **verts, int n, int dir)
 
int nmg_fu_planeeqn (struct faceuse *fu, const struct bn_tol *tol)
 
void nmg_gluefaces (struct faceuse *fulist[], int n, struct bu_list *vlfree, const struct bn_tol *tol)
 
int nmg_simplify_face (struct faceuse *fu, struct bu_list *vlfree)
 
void nmg_reverse_face (struct faceuse *fu)
 
void nmg_mv_fu_between_shells (struct shell *dest, struct shell *src, struct faceuse *fu)
 
void nmg_jf (struct faceuse *dest_fu, struct faceuse *src_fu)
 
struct faceusenmg_dup_face (struct faceuse *fu, struct shell *s)
 
struct vertexusenmg_find_v_in_face (const struct vertex *, const struct faceuse *)
 
struct vertexusenmg_find_pnt_in_face (const struct faceuse *fu, const point_t pt, const struct bn_tol *tol)
 
struct vertexusenmg_is_vertex_in_face (const struct vertex *v, const struct face *f)
 
int nmg_is_vertex_in_facelist (const struct vertex *v, const struct bu_list *hd)
 
int nmg_is_edge_in_facelist (const struct edge *e, const struct bu_list *hd)
 
int nmg_is_loop_in_facelist (const struct loop *l, const struct bu_list *fu_hd)
 
void nmg_face_tabulate (struct bu_ptbl *tab, const uint32_t *magic_p, struct bu_list *vlfree)
 
void nmg_translate_face (struct faceuse *fu, const vect_t Vec, struct bu_list *vlfree)
 
int nmg_extrude_face (struct faceuse *fu, const vect_t Vec, struct bu_list *vlfree, const struct bn_tol *tol)
 
void nmg_tabulate_face_g_verts (struct bu_ptbl *tab, const struct face_g_plane *fg)
 
int nmg_move_lu_between_fus (struct faceuse *dest, struct faceuse *src, struct loopuse *lu)
 
int nmg_calc_face_plane (struct faceuse *fu_in, plane_t pl, struct bu_list *vlfree)
 
int nmg_calc_face_g (struct faceuse *fu, struct bu_list *vlfree)
 
fastf_t nmg_faceuse_area (const struct faceuse *fu)
 
void nmg_purge_unwanted_intersection_points (struct bu_ptbl *vert_list, fastf_t *mag, const struct faceuse *fu, const struct bn_tol *tol)
 
void nmg_reverse_radials (struct faceuse *fu, const struct bn_tol *tol)
 
void nmg_reverse_face_and_radials (struct faceuse *fu, const struct bn_tol *tol)
 
void nmg_propagate_normals (struct faceuse *fu_in, long *flags, const struct bn_tol *tol)
 
struct faceusenmg_mk_new_face_from_loop (struct loopuse *lu)
 
int nmg_split_loops_into_faces (uint32_t *magic_p, struct bu_list *vlfree, const struct bn_tol *tol)
 
int nmg_find_isect_faces (const struct vertex *new_v, struct bu_ptbl *faces, int *free_edges, const struct bn_tol *tol)
 
void nmg_make_faces_at_vert (struct vertex *new_v, struct bu_ptbl *int_faces, struct bu_list *vlfree, const struct bn_tol *tol)
 
void nmg_kill_cracks_at_vertex (const struct vertex *vp)
 
int nmg_complex_vertex_solve (struct vertex *new_v, const struct bu_ptbl *faces, const int free_edges, const int approximate, struct bu_list *vlfree, const struct bn_tol *tol)
 
int nmg_faces_are_radial (const struct faceuse *fu1, const struct faceuse *fu2)
 
int nmg_triangulate_fu (struct faceuse *fu, struct bu_list *vlfree, const struct bn_tol *tol)
 
int nmg_class_pnt_f (const point_t pt, const struct faceuse *fu, const struct bn_tol *tol)
 
int nmg_class_pnt_fu_except (const point_t pt, const struct faceuse *fu, const struct loopuse *ignore_lu, void(*eu_func)(struct edgeuse *, point_t, const char *, struct bu_list *), void(*vu_func)(struct vertexuse *, point_t, const char *), const char *priv, const int call_on_hits, const int in_or_out_only, struct bu_list *vlfree, const struct bn_tol *tol)
 
int nmg_mesh_two_faces (struct faceuse *fu1, struct faceuse *fu2, const struct bn_tol *tol)
 
void nmg_mesh_faces (struct faceuse *fu1, struct faceuse *fu2, struct bu_list *vlfree, const struct bn_tol *tol)
 
int nmg_ck_vu_ptbl (struct bu_ptbl *p, struct faceuse *fu)
 
void nmg_sanitize_fu (struct faceuse *fu)
 
struct edge_g_lsegnmg_face_cutjoin (struct bu_ptbl *b1, struct bu_ptbl *b2, fastf_t *mag1, fastf_t *mag2, struct faceuse *fu1, struct faceuse *fu2, point_t pt, vect_t dir, struct edge_g_lseg *eg, struct bu_list *vlfree, const struct bn_tol *tol)
 
void nmg_fcut_face_2d (struct bu_ptbl *vu_list, fastf_t *mag, struct faceuse *fu1, struct faceuse *fu2, struct bu_list *vlfree, struct bn_tol *tol)
 
int nmg_ck_vert_on_fus (const struct vertex *v, const struct bn_tol *tol)
 
int nmg_dangling_face (const struct faceuse *fu, const char *manifolds)
 
int nmg_is_common_bigloop (const struct face *f1, const struct face *f2)
 
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)
 

Detailed Description

Routines for working with NMG Faces and Face Uses.

Macro Definition Documentation

◆ NMG_CK_FACE

#define NMG_CK_FACE (   _p)    NMG_CKMAG(_p, NMG_FACE_MAGIC, "face")

Definition at line 38 of file face.h.

◆ NMG_CK_FACE_G_PLANE

#define NMG_CK_FACE_G_PLANE (   _p)    NMG_CKMAG(_p, NMG_FACE_G_PLANE_MAGIC, "face_g_plane")

Definition at line 39 of file face.h.

◆ NMG_CK_FACE_G_SNURB

#define NMG_CK_FACE_G_SNURB (   _p)    NMG_CKMAG(_p, NMG_FACE_G_SNURB_MAGIC, "face_g_snurb")

Definition at line 40 of file face.h.

◆ NMG_CK_FACE_G_EITHER

#define NMG_CK_FACE_G_EITHER (   _p)    NMG_CK2MAG(_p, NMG_FACE_G_PLANE_MAGIC, NMG_FACE_G_SNURB_MAGIC, "face_g_plane|face_g_snurb")

Definition at line 41 of file face.h.

◆ NMG_CK_FACEUSE

#define NMG_CK_FACEUSE (   _p)    NMG_CKMAG(_p, NMG_FACEUSE_MAGIC, "faceuse")

Definition at line 42 of file face.h.

◆ NMG_GET_FU_PLANE [1/2]

#define NMG_GET_FU_PLANE (   _N,
  _fu 
)
Value:
{ \
register const struct faceuse *_fu1 = (_fu); \
register const struct face_g_plane *_fg; \
NMG_CK_FACEUSE(_fu1); \
NMG_CK_FACE(_fu1->f_p); \
_fg = _fu1->f_p->g.plane_p; \
NMG_CK_FACE_G_PLANE(_fg); \
if ((_fu1->orientation != OT_SAME) != (_fu1->f_p->flip != 0)) { \
HREVERSE(_N, _fg->N); \
} else { \
HMOVE(_N, _fg->N); \
} }
#define OT_SAME
orientation same
Definition: defines.h:79
Planar face geometry.
Definition: topology.h:341
plane_t N
Plane equation (incl normal)
Definition: topology.h:344
union face::@6 g
geometry
struct face_g_plane * plane_p
Definition: topology.h:215
int flip
!0 ==> flip normal of fg
Definition: topology.h:218
NMG topological face usage.
Definition: topology.h:230
struct face * f_p
face definition and attributes
Definition: topology.h:236
int orientation
rel to face geom defn
Definition: topology.h:234

Returns a 4-tuple (plane_t), given faceuse and state of flip flags.

Definition at line 77 of file face.h.

◆ NMG_GET_FU_PLANE [2/2]

#define NMG_GET_FU_PLANE (   _N,
  _fu 
)
Value:
{ \
register const struct faceuse *_fu1 = (_fu); \
register const struct face_g_plane *_fg; \
NMG_CK_FACEUSE(_fu1); \
NMG_CK_FACE(_fu1->f_p); \
_fg = _fu1->f_p->g.plane_p; \
NMG_CK_FACE_G_PLANE(_fg); \
if ((_fu1->orientation != OT_SAME) != (_fu1->f_p->flip != 0)) { \
HREVERSE(_N, _fg->N); \
} else { \
HMOVE(_N, _fg->N); \
} }

Returns a 4-tuple (plane_t), given faceuse and state of flip flags.

Definition at line 77 of file face.h.

◆ NMG_GET_FU_NORMAL

#define NMG_GET_FU_NORMAL (   _N,
  _fu 
)
Value:
{ \
register const struct faceuse *_fu1 = (_fu); \
register const struct face_g_plane *_fg; \
NMG_CK_FACEUSE(_fu1); \
NMG_CK_FACE(_fu1->f_p); \
_fg = _fu1->f_p->g.plane_p; \
NMG_CK_FACE_G_PLANE(_fg); \
if ((_fu1->orientation != OT_SAME) != (_fu1->f_p->flip != 0)) { \
VREVERSE(_N, _fg->N); \
} else { \
VMOVE(_N, _fg->N); \
} }

Returns a 3-tuple (vect_t), given faceuse and state of flip flags

Definition at line 61 of file face.h.

◆ GET_FACE

#define GET_FACE (   p,
 
)    {NMG_GETSTRUCT(p, face); NMG_INCR_INDEX(p, m);}

Definition at line 90 of file face.h.

◆ GET_FACE_G_PLANE

#define GET_FACE_G_PLANE (   p,
 
)    {NMG_GETSTRUCT(p, face_g_plane); NMG_INCR_INDEX(p, m);}

Definition at line 91 of file face.h.

◆ GET_FACE_G_SNURB

#define GET_FACE_G_SNURB (   p,
 
)    {NMG_GETSTRUCT(p, face_g_snurb); NMG_INCR_INDEX(p, m);}

Definition at line 92 of file face.h.

◆ GET_FACEUSE

#define GET_FACEUSE (   p,
 
)    {NMG_GETSTRUCT(p, faceuse); NMG_INCR_INDEX(p, m);}

Definition at line 93 of file face.h.

◆ FREE_FACE

#define FREE_FACE (   p)    NMG_FREESTRUCT(p, face)

Definition at line 95 of file face.h.

◆ FREE_FACE_G_PLANE

#define FREE_FACE_G_PLANE (   p)    NMG_FREESTRUCT(p, face_g_plane)

Definition at line 96 of file face.h.

◆ FREE_FACE_G_SNURB

#define FREE_FACE_G_SNURB (   p)    NMG_FREESTRUCT(p, face_g_snurb)

Definition at line 97 of file face.h.

◆ FREE_FACEUSE

#define FREE_FACEUSE (   p)    NMG_FREESTRUCT(p, faceuse)

Definition at line 98 of file face.h.

Function Documentation

◆ nmg_face_g()

void nmg_face_g ( struct faceuse fu,
const plane_t  p 
)

◆ nmg_face_new_g()

void nmg_face_new_g ( struct faceuse fu,
const plane_t  pl 
)

◆ nmg_face_bb()

void nmg_face_bb ( struct face f,
const struct bn_tol tol 
)

◆ nmg_jfg()

void nmg_jfg ( struct face f1,
struct face f2 
)

◆ nmg_find_fu_of_eu()

struct faceuse * nmg_find_fu_of_eu ( const struct edgeuse eu)

◆ nmg_find_fu_of_lu()

struct faceuse * nmg_find_fu_of_lu ( const struct loopuse lu)

◆ nmg_find_fu_of_vu()

struct faceuse * nmg_find_fu_of_vu ( const struct vertexuse vu)

◆ nmg_find_fu_with_fg_in_s()

struct faceuse * nmg_find_fu_with_fg_in_s ( const struct shell s1,
const struct faceuse fu2 
)

◆ nmg_measure_fu_angle()

double nmg_measure_fu_angle ( const struct edgeuse eu,
const vect_t  xvec,
const vect_t  yvec,
const vect_t  zvec 
)

◆ nmg_mf()

struct faceuse * nmg_mf ( struct loopuse lu1)

◆ nmg_kfu()

int nmg_kfu ( struct faceuse fu1)

◆ nmg_cmface()

struct faceuse * nmg_cmface ( struct shell s,
struct vertex **  vt[],
int  n 
)

◆ nmg_cface()

struct faceuse * nmg_cface ( struct shell s,
struct vertex **  vt,
int  n 
)

◆ nmg_add_loop_to_face()

struct faceuse * nmg_add_loop_to_face ( struct shell s,
struct faceuse fu,
struct vertex **  verts,
int  n,
int  dir 
)

◆ nmg_fu_planeeqn()

int nmg_fu_planeeqn ( struct faceuse fu,
const struct bn_tol tol 
)

◆ nmg_gluefaces()

void nmg_gluefaces ( struct faceuse fulist[],
int  n,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_simplify_face()

int nmg_simplify_face ( struct faceuse fu,
struct bu_list vlfree 
)

◆ nmg_reverse_face()

void nmg_reverse_face ( struct faceuse fu)

◆ nmg_mv_fu_between_shells()

void nmg_mv_fu_between_shells ( struct shell dest,
struct shell src,
struct faceuse fu 
)

◆ nmg_jf()

void nmg_jf ( struct faceuse dest_fu,
struct faceuse src_fu 
)

◆ nmg_dup_face()

struct faceuse * nmg_dup_face ( struct faceuse fu,
struct shell s 
)

◆ nmg_find_v_in_face()

struct vertexuse * nmg_find_v_in_face ( const struct vertex ,
const struct faceuse  
)

◆ nmg_find_pnt_in_face()

struct vertexuse * nmg_find_pnt_in_face ( const struct faceuse fu,
const point_t  pt,
const struct bn_tol tol 
)

◆ nmg_is_vertex_in_face()

struct vertexuse * nmg_is_vertex_in_face ( const struct vertex v,
const struct face f 
)

◆ nmg_is_vertex_in_facelist()

int nmg_is_vertex_in_facelist ( const struct vertex v,
const struct bu_list hd 
)

◆ nmg_is_edge_in_facelist()

int nmg_is_edge_in_facelist ( const struct edge e,
const struct bu_list hd 
)

◆ nmg_is_loop_in_facelist()

int nmg_is_loop_in_facelist ( const struct loop l,
const struct bu_list fu_hd 
)

◆ nmg_face_tabulate()

void nmg_face_tabulate ( struct bu_ptbl tab,
const uint32_t *  magic_p,
struct bu_list vlfree 
)

◆ nmg_translate_face()

void nmg_translate_face ( struct faceuse fu,
const vect_t  Vec,
struct bu_list vlfree 
)

◆ nmg_extrude_face()

int nmg_extrude_face ( struct faceuse fu,
const vect_t  Vec,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_tabulate_face_g_verts()

void nmg_tabulate_face_g_verts ( struct bu_ptbl tab,
const struct face_g_plane fg 
)

◆ nmg_move_lu_between_fus()

int nmg_move_lu_between_fus ( struct faceuse dest,
struct faceuse src,
struct loopuse lu 
)

◆ nmg_calc_face_plane()

int nmg_calc_face_plane ( struct faceuse fu_in,
plane_t  pl,
struct bu_list vlfree 
)

◆ nmg_calc_face_g()

int nmg_calc_face_g ( struct faceuse fu,
struct bu_list vlfree 
)

◆ nmg_faceuse_area()

fastf_t nmg_faceuse_area ( const struct faceuse fu)

◆ nmg_purge_unwanted_intersection_points()

void nmg_purge_unwanted_intersection_points ( struct bu_ptbl vert_list,
fastf_t mag,
const struct faceuse fu,
const struct bn_tol tol 
)

◆ nmg_reverse_radials()

void nmg_reverse_radials ( struct faceuse fu,
const struct bn_tol tol 
)

◆ nmg_reverse_face_and_radials()

void nmg_reverse_face_and_radials ( struct faceuse fu,
const struct bn_tol tol 
)

◆ nmg_propagate_normals()

void nmg_propagate_normals ( struct faceuse fu_in,
long *  flags,
const struct bn_tol tol 
)

◆ nmg_mk_new_face_from_loop()

struct faceuse * nmg_mk_new_face_from_loop ( struct loopuse lu)

◆ nmg_split_loops_into_faces()

int nmg_split_loops_into_faces ( uint32_t *  magic_p,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_find_isect_faces()

int nmg_find_isect_faces ( const struct vertex new_v,
struct bu_ptbl faces,
int *  free_edges,
const struct bn_tol tol 
)

◆ nmg_make_faces_at_vert()

void nmg_make_faces_at_vert ( struct vertex new_v,
struct bu_ptbl int_faces,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_kill_cracks_at_vertex()

void nmg_kill_cracks_at_vertex ( const struct vertex vp)

◆ nmg_complex_vertex_solve()

int nmg_complex_vertex_solve ( struct vertex new_v,
const struct bu_ptbl faces,
const int  free_edges,
const int  approximate,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_faces_are_radial()

int nmg_faces_are_radial ( const struct faceuse fu1,
const struct faceuse fu2 
)

◆ nmg_triangulate_fu()

int nmg_triangulate_fu ( struct faceuse fu,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_class_pnt_f()

int nmg_class_pnt_f ( const point_t  pt,
const struct faceuse fu,
const struct bn_tol tol 
)

◆ nmg_class_pnt_fu_except()

int nmg_class_pnt_fu_except ( const point_t  pt,
const struct faceuse fu,
const struct loopuse ignore_lu,
void(*)(struct edgeuse *, point_t, const char *, struct bu_list *)  eu_func,
void(*)(struct vertexuse *, point_t, const char *)  vu_func,
const char *  priv,
const int  call_on_hits,
const int  in_or_out_only,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_mesh_two_faces()

int nmg_mesh_two_faces ( struct faceuse fu1,
struct faceuse fu2,
const struct bn_tol tol 
)

◆ nmg_mesh_faces()

void nmg_mesh_faces ( struct faceuse fu1,
struct faceuse fu2,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_ck_vu_ptbl()

int nmg_ck_vu_ptbl ( struct bu_ptbl p,
struct faceuse fu 
)

◆ nmg_sanitize_fu()

void nmg_sanitize_fu ( struct faceuse fu)

◆ nmg_face_cutjoin()

struct edge_g_lseg * nmg_face_cutjoin ( struct bu_ptbl b1,
struct bu_ptbl b2,
fastf_t mag1,
fastf_t mag2,
struct faceuse fu1,
struct faceuse fu2,
point_t  pt,
vect_t  dir,
struct edge_g_lseg eg,
struct bu_list vlfree,
const struct bn_tol tol 
)

◆ nmg_fcut_face_2d()

void nmg_fcut_face_2d ( struct bu_ptbl vu_list,
fastf_t mag,
struct faceuse fu1,
struct faceuse fu2,
struct bu_list vlfree,
struct bn_tol tol 
)

◆ nmg_ck_vert_on_fus()

int nmg_ck_vert_on_fus ( const struct vertex v,
const struct bn_tol tol 
)

◆ nmg_dangling_face()

int nmg_dangling_face ( const struct faceuse fu,
const char *  manifolds 
)

◆ nmg_is_common_bigloop()

int nmg_is_common_bigloop ( const struct face f1,
const struct face f2 
)

◆ nmg_ck_fu_verts()

int nmg_ck_fu_verts ( struct faceuse fu1,
struct face f2,
const struct bn_tol tol 
)

◆ nmg_ck_fg_verts()

int nmg_ck_fg_verts ( struct faceuse fu1,
struct face f2,
const struct bn_tol tol 
)

◆ nmg_two_face_fuse()

int nmg_two_face_fuse ( struct face f1,
struct face f2,
const struct bn_tol tol 
)