Revision: 69070
          http://sourceforge.net/p/brlcad/code/69070
Author:   starseeker
Date:     2016-10-15 15:42:28 +0000 (Sat, 15 Oct 2016)
Log Message:
-----------
Start on the next stage of de-entanglement - move things in rt/nmg.h that 
belong in nmg.h to their new home and remove rt/nmg.h as an include.  Looks 
like it will expose another class of rt dependencies that need to be resolved.

Modified Paths:
--------------
    brlcad/trunk/include/nmg.h
    brlcad/trunk/include/rt/nmg.h
    brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_class.c

Modified: brlcad/trunk/include/nmg.h
===================================================================
--- brlcad/trunk/include/nmg.h  2016-10-14 22:05:17 UTC (rev 69069)
+++ brlcad/trunk/include/nmg.h  2016-10-15 15:42:28 UTC (rev 69070)
@@ -40,8 +40,13 @@
 #include "bu/log.h"
 #include "bu/magic.h"
 #include "bu/ptbl.h"
+#include "bn/tol.h"
+#include "bn/vlist.h"
 #include "vmath.h"
+#include "rt/defines.h" /* for RT_EXPORT */
 
+__BEGIN_DECLS
+
 #define DEBUG_PL_ANIM   0x00000001     /**< @brief 1 mged: animated evaluation 
*/
 #define DEBUG_PL_SLOW   0x00000002     /**< @brief 2 mged: add delays to 
animation */
 #define DEBUG_GRAPHCL   0x00000004     /**< @brief 3 mged: graphic 
classification */
@@ -153,6 +158,9 @@
                bu_bomb("bye"); \
        }
 
+
+RT_EXPORT extern uint32_t nmg_debug;      /**< @brief  debug bits for NMG's 
see nmg.h */
+
 /**
  * @brief
  * Definition of a knot vector.
@@ -779,6 +787,1488 @@
     void (*vis_vertex_g)(uint32_t *, void *, int);
 };
 
+struct nmg_radial {
+    struct bu_list      l;
+    struct edgeuse      *eu;
+    struct faceuse      *fu;            /**< @brief  Derived from eu */
+    struct shell        *s;             /**< @brief  Derived from eu */
+    int                 existing_flag;  /**< @brief  !0 if this eu exists on 
dest edge */
+    int                 is_crack;       /**< @brief  This eu is part of a 
crack. */
+    int                 is_outie;       /**< @brief  This crack is an "outie" 
*/
+    int                 needs_flip;     /**< @brief  Insert eumate, not eu */
+    fastf_t             ang;            /**< @brief  angle, in radians.  0 to 
2pi */
+};
+#define NMG_CK_RADIAL(_p) NMG_CKMAG(_p, NMG_RADIAL_MAGIC, "nmg_radial")
+
+struct nmg_inter_struct {
+    uint32_t            magic;
+    struct bu_ptbl      *l1;            /**< @brief  vertexuses on the line of 
*/
+    struct bu_ptbl      *l2;            /**< @brief  intersection between 
planes */
+    fastf_t             *mag1;          /**< @brief  Distances along 
intersection line */
+    fastf_t             *mag2;          /**< @brief  for each vertexuse in l1 
and l2. */
+    size_t              mag_len;        /**< @brief  Array size of mag1 and 
mag2 */
+    struct shell        *s1;
+    struct shell        *s2;
+    struct faceuse      *fu1;           /**< @brief  null if l1 comes from a 
wire */
+    struct faceuse      *fu2;           /**< @brief  null if l2 comes from a 
wire */
+    struct bn_tol       tol;
+    int                 coplanar;       /**< @brief  a flag */
+    struct edge_g_lseg  *on_eg;         /**< @brief  edge_g for line of 
intersection */
+    point_t             pt;             /**< @brief  3D line of intersection */
+    vect_t              dir;
+    point_t             pt2d;           /**< @brief  2D projection of isect 
line */
+    vect_t              dir2d;
+    fastf_t             *vert2d;        /**< @brief  Array of 2d vertex 
projections [index] */
+    size_t              maxindex;       /**< @brief  size of vert2d[] */
+    mat_t               proj;           /**< @brief  Matrix to project onto XY 
plane */
+    const uint32_t      *twod;          /**< @brief  ptr to face/edge of 2d 
projection */
+};
+#define NMG_CK_INTER_STRUCT(_p) NMG_CKMAG(_p, NMG_INTER_STRUCT_MAGIC, 
"nmg_inter_struct")
+
+
+
+/* From file nmg_mk.c */
+/*      MAKE routines */
+RT_EXPORT extern struct model *nmg_mm(void);
+RT_EXPORT extern struct model *nmg_mmr(void);
+RT_EXPORT extern struct nmgregion *nmg_mrsv(struct model *m);
+RT_EXPORT extern struct shell *nmg_msv(struct nmgregion *r_p);
+RT_EXPORT extern struct faceuse *nmg_mf(struct loopuse *lu1);
+RT_EXPORT extern struct loopuse *nmg_mlv(uint32_t *magic,
+                                         struct vertex *v,
+                                         int orientation);
+RT_EXPORT extern struct edgeuse *nmg_me(struct vertex *v1,
+                                        struct vertex *v2,
+                                        struct shell *s);
+RT_EXPORT extern struct edgeuse *nmg_meonvu(struct vertexuse *vu);
+RT_EXPORT extern struct loopuse *nmg_ml(struct shell *s);
+/*      KILL routines */
+RT_EXPORT extern int nmg_keg(struct edgeuse *eu);
+RT_EXPORT extern int nmg_kvu(struct vertexuse *vu);
+RT_EXPORT extern int nmg_kfu(struct faceuse *fu1);
+RT_EXPORT extern int nmg_klu(struct loopuse *lu1);
+RT_EXPORT extern int nmg_keu(struct edgeuse *eu);
+RT_EXPORT extern int nmg_keu_zl(struct shell *s,
+                                const struct bn_tol *tol);
+RT_EXPORT extern int nmg_ks(struct shell *s);
+RT_EXPORT extern int nmg_kr(struct nmgregion *r);
+RT_EXPORT extern void nmg_km(struct model *m);
+/*      Geometry and Attribute routines */
+RT_EXPORT extern void nmg_vertex_gv(struct vertex *v,
+                                    const point_t pt);
+RT_EXPORT extern void nmg_vertex_g(struct vertex *v,
+                                   fastf_t x,
+                                   fastf_t y,
+                                   fastf_t z);
+RT_EXPORT extern void nmg_vertexuse_nv(struct vertexuse *vu,
+                                       const vect_t norm);
+RT_EXPORT extern void nmg_vertexuse_a_cnurb(struct vertexuse *vu,
+                                            const fastf_t *uvw);
+RT_EXPORT extern void nmg_edge_g(struct edgeuse *eu);
+RT_EXPORT extern void nmg_edge_g_cnurb(struct edgeuse *eu,
+                                       int order,
+                                       int n_knots,
+                                       fastf_t *kv,
+                                       int n_pts,
+                                       int pt_type,
+                                       fastf_t *points);
+RT_EXPORT extern void nmg_edge_g_cnurb_plinear(struct edgeuse *eu);
+RT_EXPORT extern int nmg_use_edge_g(struct edgeuse *eu,
+                                    uint32_t *eg);
+RT_EXPORT extern void nmg_loop_g(struct loop *l,
+                                 const struct bn_tol *tol);
+RT_EXPORT extern void nmg_face_g(struct faceuse *fu,
+                                 const plane_t p);
+RT_EXPORT extern void nmg_face_new_g(struct faceuse *fu,
+                                     const plane_t pl);
+RT_EXPORT extern void nmg_face_g_snurb(struct faceuse *fu,
+                                       int u_order,
+                                       int v_order,
+                                       int n_u_knots,
+                                       int n_v_knots,
+                                       fastf_t *ukv,
+                                       fastf_t *vkv,
+                                       int n_rows,
+                                       int n_cols,
+                                       int pt_type,
+                                       fastf_t *mesh);
+RT_EXPORT extern void nmg_face_bb(struct face *f,
+                                  const struct bn_tol *tol);
+RT_EXPORT extern void nmg_shell_a(struct shell *s,
+                                  const struct bn_tol *tol);
+RT_EXPORT extern void nmg_region_a(struct nmgregion *r,
+                                   const struct bn_tol *tol);
+/*      DEMOTE routines */
+RT_EXPORT extern int nmg_demote_lu(struct loopuse *lu);
+RT_EXPORT extern int nmg_demote_eu(struct edgeuse *eu);
+/*      MODIFY routines */
+RT_EXPORT extern void nmg_movevu(struct vertexuse *vu,
+                                 struct vertex *v);
+RT_EXPORT extern void nmg_je(struct edgeuse *eudst,
+                             struct edgeuse *eusrc);
+RT_EXPORT extern void nmg_unglueedge(struct edgeuse *eu);
+RT_EXPORT extern void nmg_jv(struct vertex *v1,
+                             struct vertex *v2);
+RT_EXPORT extern void nmg_jfg(struct face *f1,
+                              struct face *f2);
+RT_EXPORT extern void nmg_jeg(struct edge_g_lseg *dest_eg,
+                              struct edge_g_lseg *src_eg);
+
+/* From nmg_mod.c */
+/*      REGION Routines */
+RT_EXPORT extern void nmg_merge_regions(struct nmgregion *r1,
+                                        struct nmgregion *r2,
+                                        const struct bn_tol *tol);
+
+/*      SHELL Routines */
+RT_EXPORT extern void nmg_shell_coplanar_face_merge(struct shell *s,
+                                                    const struct bn_tol *tol,
+                                                    const int simplify,
+                                                   struct bu_list *vlfree);
+RT_EXPORT extern int nmg_simplify_shell(struct shell *s, struct bu_list 
*vlfree);
+RT_EXPORT extern void nmg_rm_redundancies(struct shell *s,
+                                          struct bu_list *vlfree,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern void nmg_sanitize_s_lv(struct shell *s,
+                                        int orient);
+RT_EXPORT extern void nmg_s_split_touchingloops(struct shell *s,
+                                                const struct bn_tol *tol);
+RT_EXPORT extern void nmg_s_join_touchingloops(struct shell             *s,
+                                               const struct bn_tol      *tol);
+RT_EXPORT extern void nmg_js(struct shell       *s1,
+                             struct shell       *s2,
+                            struct bu_list *vlfree,
+                             const struct bn_tol        *tol);
+RT_EXPORT extern void nmg_invert_shell(struct shell             *s);
+
+/*      FACE Routines */
+RT_EXPORT extern struct faceuse *nmg_cmface(struct shell *s,
+                                            struct vertex **vt[],
+                                            int n);
+RT_EXPORT extern struct faceuse *nmg_cface(struct shell *s,
+                                           struct vertex **vt,
+                                           int n);
+RT_EXPORT extern struct faceuse *nmg_add_loop_to_face(struct shell *s,
+                                                      struct faceuse *fu,
+                                                      struct vertex **verts,
+                                                      int n,
+                                                      int dir);
+RT_EXPORT extern int nmg_fu_planeeqn(struct faceuse *fu,
+                                     const struct bn_tol *tol);
+RT_EXPORT extern void nmg_gluefaces(struct faceuse *fulist[],
+                                    int n,
+                                   struct bu_list *vlfree,
+                                    const struct bn_tol *tol);
+RT_EXPORT extern int nmg_simplify_face(struct faceuse *fu, struct bu_list 
*vlfree);
+RT_EXPORT extern void nmg_reverse_face(struct faceuse *fu);
+RT_EXPORT extern void nmg_mv_fu_between_shells(struct shell *dest,
+                                               struct shell *src,
+                                               struct faceuse *fu);
+RT_EXPORT extern void nmg_jf(struct faceuse *dest_fu,
+                             struct faceuse *src_fu);
+RT_EXPORT extern struct faceuse *nmg_dup_face(struct faceuse *fu,
+                                              struct shell *s);
+/*      LOOP Routines */
+RT_EXPORT extern void nmg_jl(struct loopuse *lu,
+                             struct edgeuse *eu);
+RT_EXPORT extern struct vertexuse *nmg_join_2loops(struct vertexuse *vu1,
+                                                   struct vertexuse *vu2);
+RT_EXPORT extern struct vertexuse *nmg_join_singvu_loop(struct vertexuse *vu1,
+                                                        struct vertexuse *vu2);
+RT_EXPORT extern struct vertexuse *nmg_join_2singvu_loops(struct vertexuse 
*vu1,
+                                                          struct vertexuse 
*vu2);
+RT_EXPORT extern struct loopuse *nmg_cut_loop(struct vertexuse *vu1,
+                                              struct vertexuse *vu2,
+                                             struct bu_list *vlfree);
+RT_EXPORT extern struct loopuse *nmg_split_lu_at_vu(struct loopuse *lu,
+                                                    struct vertexuse *vu);
+RT_EXPORT extern struct vertexuse *nmg_find_repeated_v_in_lu(struct vertexuse 
*vu);
+RT_EXPORT extern void nmg_split_touchingloops(struct loopuse *lu,
+                                              const struct bn_tol *tol);
+RT_EXPORT extern int nmg_join_touchingloops(struct loopuse *lu);
+RT_EXPORT extern int nmg_get_touching_jaunts(const struct loopuse *lu,
+                                             struct bu_ptbl *tbl,
+                                             int *need_init);
+RT_EXPORT extern void nmg_kill_accordions(struct loopuse *lu);
+RT_EXPORT extern int nmg_loop_split_at_touching_jaunt(struct loopuse           
 *lu,
+                                                      const struct bn_tol      
 *tol);
+RT_EXPORT extern void nmg_simplify_loop(struct loopuse *lu, struct bu_list 
*vlfree);
+RT_EXPORT extern int nmg_kill_snakes(struct loopuse *lu, struct bu_list 
*vlfree);
+RT_EXPORT extern void nmg_mv_lu_between_shells(struct shell *dest,
+                                               struct shell *src,
+                                               struct loopuse *lu);
+RT_EXPORT extern void nmg_moveltof(struct faceuse *fu,
+                                   struct shell *s);
+RT_EXPORT extern struct loopuse *nmg_dup_loop(struct loopuse *lu,
+                                              uint32_t *parent,
+                                              long **trans_tbl);
+RT_EXPORT extern void nmg_set_lu_orientation(struct loopuse *lu,
+                                             int is_opposite);
+RT_EXPORT extern void nmg_lu_reorient(struct loopuse *lu);
+/*      EDGE Routines */
+RT_EXPORT extern struct edgeuse *nmg_eusplit(struct vertex *v,
+                                             struct edgeuse *oldeu,
+                                             int share_geom);
+RT_EXPORT extern struct edgeuse *nmg_esplit(struct vertex *v,
+                                            struct edgeuse *eu,
+                                            int share_geom);
+RT_EXPORT extern struct edgeuse *nmg_ebreak(struct vertex *v,
+                                            struct edgeuse *eu);
+RT_EXPORT extern struct edgeuse *nmg_ebreaker(struct vertex *v,
+                                              struct edgeuse *eu,
+                                              const struct bn_tol *tol);
+RT_EXPORT extern struct vertex *nmg_e2break(struct edgeuse *eu1,
+                                            struct edgeuse *eu2);
+RT_EXPORT extern int nmg_unbreak_edge(struct edgeuse *eu1_first);
+RT_EXPORT extern int nmg_unbreak_shell_edge_unsafe(struct edgeuse *eu1_first);
+RT_EXPORT extern struct edgeuse *nmg_eins(struct edgeuse *eu);
+RT_EXPORT extern void nmg_mv_eu_between_shells(struct shell *dest,
+                                               struct shell *src,
+                                               struct edgeuse *eu);
+/*      VERTEX Routines */
+RT_EXPORT extern void nmg_mv_vu_between_shells(struct shell *dest,
+                                               struct shell *src,
+                                               struct vertexuse *vu);
+
+/* From nmg_info.c */
+/* Model routines */
+RT_EXPORT extern struct model *nmg_find_model(const uint32_t *magic_p);
+RT_EXPORT extern struct shell *nmg_find_shell(const uint32_t *magic_p);
+RT_EXPORT extern void nmg_model_bb(point_t min_pt,
+                                   point_t max_pt,
+                                   const struct model *m);
+
+
+/* Shell routines */
+RT_EXPORT extern int nmg_shell_is_empty(const struct shell *s);
+RT_EXPORT extern struct shell *nmg_find_s_of_lu(const struct loopuse *lu);
+RT_EXPORT extern struct shell *nmg_find_s_of_eu(const struct edgeuse *eu);
+RT_EXPORT extern struct shell *nmg_find_s_of_vu(const struct vertexuse *vu);
+
+/* Face routines */
+RT_EXPORT extern struct faceuse *nmg_find_fu_of_eu(const struct edgeuse *eu);
+RT_EXPORT extern struct faceuse *nmg_find_fu_of_lu(const struct loopuse *lu);
+RT_EXPORT extern struct faceuse *nmg_find_fu_of_vu(const struct vertexuse *vu);
+RT_EXPORT extern struct faceuse *nmg_find_fu_with_fg_in_s(const struct shell 
*s1,
+                                                          const struct faceuse 
*fu2);
+RT_EXPORT extern double nmg_measure_fu_angle(const struct edgeuse *eu,
+                                             const vect_t xvec,
+                                             const vect_t yvec,
+                                             const vect_t zvec);
+
+/* Loop routines */
+RT_EXPORT extern struct loopuse*nmg_find_lu_of_vu(const struct vertexuse *vu);
+RT_EXPORT extern int nmg_loop_is_a_crack(const struct loopuse *lu);
+RT_EXPORT extern int    nmg_loop_is_ccw(const struct loopuse *lu,
+                                        const plane_t norm,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern const struct vertexuse *nmg_loop_touches_self(const struct 
loopuse *lu);
+RT_EXPORT extern int nmg_2lu_identical(const struct edgeuse *eu1,
+                                       const struct edgeuse *eu2);
+
+/* Edge routines */
+RT_EXPORT extern struct edgeuse *nmg_find_matching_eu_in_s(const struct 
edgeuse *eu1,
+                                                           const struct shell  
 *s2);
+RT_EXPORT extern struct edgeuse *nmg_findeu(const struct vertex *v1,
+                                            const struct vertex *v2,
+                                            const struct shell *s,
+                                            const struct edgeuse *eup,
+                                            int dangling_only);
+RT_EXPORT extern struct edgeuse *nmg_find_eu_in_face(const struct vertex *v1,
+                                                     const struct vertex *v2,
+                                                     const struct faceuse *fu,
+                                                     const struct edgeuse *eup,
+                                                     int dangling_only);
+RT_EXPORT extern struct edgeuse *nmg_find_e(const struct vertex *v1,
+                                            const struct vertex *v2,
+                                            const struct shell *s,
+                                            const struct edge *ep);
+RT_EXPORT extern struct edgeuse *nmg_find_eu_of_vu(const struct vertexuse *vu);
+RT_EXPORT extern struct edgeuse *nmg_find_eu_with_vu_in_lu(const struct 
loopuse *lu,
+                                                           const struct 
vertexuse *vu);
+RT_EXPORT extern const struct edgeuse *nmg_faceradial(const struct edgeuse 
*eu);
+RT_EXPORT extern const struct edgeuse *nmg_radial_face_edge_in_shell(const 
struct edgeuse *eu);
+RT_EXPORT extern const struct edgeuse *nmg_find_edge_between_2fu(const struct 
faceuse *fu1,
+                                                                 const struct 
faceuse *fu2,
+                                                                struct bu_list 
*vlfree,
+                                                                 const struct 
bn_tol *tol);
+RT_EXPORT extern struct edge *nmg_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);
+RT_EXPORT extern struct edgeuse *nmg_find_matching_eu_in_s(const struct 
edgeuse *eu1,
+                                                           const struct shell 
*s2);
+RT_EXPORT extern void nmg_eu_2vecs_perp(vect_t xvec,
+                                        vect_t yvec,
+                                        vect_t zvec,
+                                        const struct edgeuse *eu,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern int nmg_find_eu_leftvec(vect_t left,
+                                         const struct edgeuse *eu);
+RT_EXPORT extern int nmg_find_eu_left_non_unit(vect_t left,
+                                               const struct edgeuse     *eu);
+RT_EXPORT extern struct edgeuse *nmg_find_ot_same_eu_of_e(const struct edge 
*e);
+
+/* Vertex routines */
+RT_EXPORT extern struct vertexuse *nmg_find_v_in_face(const struct vertex *,
+                                                      const struct faceuse *);
+RT_EXPORT extern struct vertexuse *nmg_find_v_in_shell(const struct vertex *v,
+                                                       const struct shell *s,
+                                                       int edges_only);
+RT_EXPORT extern struct vertexuse *nmg_find_pt_in_lu(const struct loopuse *lu,
+                                                     const point_t pt,
+                                                     const struct bn_tol *tol);
+RT_EXPORT extern struct vertexuse *nmg_find_pt_in_face(const struct faceuse 
*fu,
+                                                       const point_t pt,
+                                                       const struct bn_tol 
*tol);
+RT_EXPORT extern struct vertex *nmg_find_pt_in_shell(const struct shell *s,
+                                                     const point_t pt,
+                                                     const struct bn_tol *tol);
+RT_EXPORT extern struct vertex *nmg_find_pt_in_model(const struct model *m,
+                                                     const point_t pt,
+                                                     const struct bn_tol *tol);
+RT_EXPORT extern int nmg_is_vertex_in_edgelist(const struct vertex *v,
+                                               const struct bu_list *hd);
+RT_EXPORT extern int nmg_is_vertex_in_looplist(const struct vertex *v,
+                                               const struct bu_list *hd,
+                                               int singletons);
+RT_EXPORT extern struct vertexuse *nmg_is_vertex_in_face(const struct vertex 
*v,
+                                                         const struct face *f);
+RT_EXPORT extern int nmg_is_vertex_a_selfloop_in_shell(const struct vertex *v,
+                                                       const struct shell *s);
+RT_EXPORT extern int nmg_is_vertex_in_facelist(const struct vertex *v,
+                                               const struct bu_list *hd);
+RT_EXPORT extern int nmg_is_edge_in_edgelist(const struct edge *e,
+                                             const struct bu_list *hd);
+RT_EXPORT extern int nmg_is_edge_in_looplist(const struct edge *e,
+                                             const struct bu_list *hd);
+RT_EXPORT extern int nmg_is_edge_in_facelist(const struct edge *e,
+                                             const struct bu_list *hd);
+RT_EXPORT extern int nmg_is_loop_in_facelist(const struct loop *l,
+                                             const struct bu_list *fu_hd);
+
+/* Tabulation routines */
+RT_EXPORT extern void nmg_vertex_tabulate(struct bu_ptbl *tab,
+                                          const uint32_t *magic_p,
+                                         struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vertexuse_normal_tabulate(struct bu_ptbl *tab,
+                                                    const uint32_t *magic_p,
+                                                   struct bu_list *vlfree);
+RT_EXPORT extern void nmg_edgeuse_tabulate(struct bu_ptbl *tab,
+                                           const uint32_t *magic_p,
+                                          struct bu_list *vlfree);
+RT_EXPORT extern void nmg_edge_tabulate(struct bu_ptbl *tab,
+                                        const uint32_t *magic_p,
+                                       struct bu_list *vlfree);
+RT_EXPORT extern void nmg_edge_g_tabulate(struct bu_ptbl *tab,
+                                          const uint32_t *magic_p,
+                                         struct bu_list *vlfree);
+RT_EXPORT extern void nmg_face_tabulate(struct bu_ptbl *tab,
+                                        const uint32_t *magic_p,
+                                       struct bu_list *vlfree);
+RT_EXPORT extern void nmg_edgeuse_with_eg_tabulate(struct bu_ptbl *tab,
+                                                   const struct edge_g_lseg 
*eg);
+RT_EXPORT extern 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);
+RT_EXPORT extern void nmg_e_and_v_tabulate(struct bu_ptbl *eutab,
+                                           struct bu_ptbl *vtab,
+                                           const uint32_t *magic_p,
+                                          struct bu_list *vlfree);
+RT_EXPORT extern int nmg_2edgeuse_g_coincident(const struct edgeuse     *eu1,
+                                               const struct edgeuse     *eu2,
+                                               const struct bn_tol      *tol);
+
+/* From nmg_extrude.c */
+RT_EXPORT extern void nmg_translate_face(struct faceuse *fu, const vect_t Vec, 
struct bu_list *vlfree);
+RT_EXPORT extern int nmg_extrude_face(struct faceuse *fu, const vect_t Vec, 
struct bu_list *vlfree, const struct bn_tol *tol);
+RT_EXPORT extern struct vertexuse *nmg_find_vertex_in_lu(const struct vertex 
*v, const struct loopuse *lu);
+RT_EXPORT extern void nmg_fix_overlapping_loops(struct shell *s, struct 
bu_list *vlfree, const struct bn_tol *tol);
+RT_EXPORT extern void nmg_break_crossed_loops(struct shell *is, const struct 
bn_tol *tol);
+RT_EXPORT extern struct shell *nmg_extrude_cleanup(struct shell *is, const int 
is_void, struct bu_list *vlfree, const struct bn_tol *tol);
+RT_EXPORT extern void nmg_hollow_shell(struct shell *s, const fastf_t thick, 
const int approximate, struct bu_list *vlfree, const struct bn_tol *tol);
+RT_EXPORT extern struct shell *nmg_extrude_shell(struct shell *s, const 
fastf_t dist, const int normal_ward, const int approximate, struct bu_list 
*vlfree, const struct bn_tol *tol);
+
+/* From nmg_pr.c */
+RT_EXPORT extern char *nmg_orientation(int orientation);
+RT_EXPORT extern void nmg_pr_orient(int orientation,
+                                    const char *h);
+RT_EXPORT extern void nmg_pr_m(const struct model *m);
+RT_EXPORT extern void nmg_pr_r(const struct nmgregion *r,
+                               char *h);
+RT_EXPORT extern void nmg_pr_sa(const struct shell_a *sa,
+                                char *h);
+RT_EXPORT extern void nmg_pr_lg(const struct loop_g *lg,
+                                char *h);
+RT_EXPORT extern void nmg_pr_fg(const uint32_t *magic,
+                                char *h);
+RT_EXPORT extern void nmg_pr_s(const struct shell *s,
+                               char *h);
+RT_EXPORT extern void  nmg_pr_s_briefly(const struct shell *s,
+                                        char *h);
+RT_EXPORT extern void nmg_pr_f(const struct face *f,
+                               char *h);
+RT_EXPORT extern void nmg_pr_fu(const struct faceuse *fu,
+                                char *h);
+RT_EXPORT extern void nmg_pr_fu_briefly(const struct faceuse *fu,
+                                        char *h);
+RT_EXPORT extern void nmg_pr_l(const struct loop *l,
+                               char *h);
+RT_EXPORT extern void nmg_pr_lu(const struct loopuse *lu,
+                                char *h);
+RT_EXPORT extern void nmg_pr_lu_briefly(const struct loopuse *lu,
+                                        char *h);
+RT_EXPORT extern void nmg_pr_eg(const uint32_t *eg,
+                                char *h);
+RT_EXPORT extern void nmg_pr_e(const struct edge *e,
+                               char *h);
+RT_EXPORT extern void nmg_pr_eu(const struct edgeuse *eu,
+                                char *h);
+RT_EXPORT extern void nmg_pr_eu_briefly(const struct edgeuse *eu,
+                                        char *h);
+RT_EXPORT extern void nmg_pr_eu_endpoints(const struct edgeuse *eu,
+                                          char *h);
+RT_EXPORT extern void nmg_pr_vg(const struct vertex_g *vg,
+                                char *h);
+RT_EXPORT extern void nmg_pr_v(const struct vertex *v,
+                               char *h);
+RT_EXPORT extern void nmg_pr_vu(const struct vertexuse *vu,
+                                char *h);
+RT_EXPORT extern void nmg_pr_vu_briefly(const struct vertexuse *vu,
+                                        char *h);
+RT_EXPORT extern void nmg_pr_vua(const uint32_t *magic_p,
+                                 char *h);
+RT_EXPORT extern void nmg_euprint(const char *str,
+                                  const struct edgeuse *eu);
+RT_EXPORT extern void nmg_pr_ptbl(const char *title,
+                                  const struct bu_ptbl *tbl,
+                                  int verbose);
+RT_EXPORT extern void nmg_pr_ptbl_vert_list(const char *str,
+                                            const struct bu_ptbl *tbl,
+                                            const fastf_t *mag);
+RT_EXPORT extern void nmg_pr_one_eu_vecs(const struct edgeuse *eu,
+                                         const vect_t xvec,
+                                         const vect_t yvec,
+                                         const vect_t zvec,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern void nmg_pr_fu_around_eu_vecs(const struct edgeuse *eu,
+                                               const vect_t xvec,
+                                               const vect_t yvec,
+                                               const vect_t zvec,
+                                               const struct bn_tol *tol);
+RT_EXPORT extern void nmg_pr_fu_around_eu(const struct edgeuse *eu,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern void nmg_pl_lu_around_eu(const struct edgeuse *eu, struct 
bu_list *vlfree);
+RT_EXPORT extern void nmg_pr_fus_in_fg(const uint32_t *fg_magic);
+
+/* From nmg_misc.c */
+RT_EXPORT extern int nmg_snurb_calc_lu_uv_orient(const struct loopuse *lu);
+RT_EXPORT extern void nmg_snurb_fu_eval(const struct faceuse *fu,
+                                        const fastf_t u,
+                                        const fastf_t v,
+                                        point_t pt_on_srf);
+RT_EXPORT extern void nmg_snurb_fu_get_norm(const struct faceuse *fu,
+                                            const fastf_t u,
+                                            const fastf_t v,
+                                            vect_t norm);
+RT_EXPORT extern void nmg_snurb_fu_get_norm_at_vu(const struct faceuse *fu,
+                                                  const struct vertexuse *vu,
+                                                  vect_t norm);
+RT_EXPORT extern void nmg_find_zero_length_edges(const struct model *m, struct 
bu_list *vlfree);
+RT_EXPORT extern struct face *nmg_find_top_face_in_dir(const struct shell *s,
+                                                       int dir, long *flags);
+RT_EXPORT extern struct face *nmg_find_top_face(const struct shell *s,
+                                                int *dir,
+                                                long *flags);
+RT_EXPORT extern int nmg_find_outer_and_void_shells(struct nmgregion *r,
+                                                    struct bu_ptbl ***shells,
+                                                   struct bu_list *vlfree,
+                                                    const struct bn_tol *tol);
+RT_EXPORT extern int nmg_mark_edges_real(const uint32_t *magic_p, struct 
bu_list *vlfree);
+RT_EXPORT extern void nmg_tabulate_face_g_verts(struct bu_ptbl *tab,
+                                                const struct face_g_plane *fg);
+RT_EXPORT extern void nmg_isect_shell_self(struct shell *s,
+                                          struct bu_list *vlfree,
+                                           const struct bn_tol *tol);
+RT_EXPORT extern struct edgeuse *nmg_next_radial_eu(const struct edgeuse *eu,
+                                                    const struct shell *s,
+                                                    const int wires);
+RT_EXPORT extern struct edgeuse *nmg_prev_radial_eu(const struct edgeuse *eu,
+                                                    const struct shell *s,
+                                                    const int wires);
+RT_EXPORT extern int nmg_radial_face_count(const struct edgeuse *eu,
+                                           const struct shell *s);
+RT_EXPORT extern int nmg_check_closed_shell(const struct shell *s,
+                                            const struct bn_tol *tol);
+RT_EXPORT extern int nmg_move_lu_between_fus(struct faceuse *dest,
+                                             struct faceuse *src,
+                                             struct loopuse *lu);
+RT_EXPORT extern void nmg_loop_plane_newell(const struct loopuse *lu,
+                                            plane_t pl);
+RT_EXPORT extern fastf_t nmg_loop_plane_area(const struct loopuse *lu,
+                                             plane_t pl);
+RT_EXPORT extern fastf_t nmg_loop_plane_area2(const struct loopuse *lu,
+                                              plane_t pl,
+                                              const struct bn_tol *tol);
+RT_EXPORT extern int nmg_calc_face_plane(struct faceuse *fu_in,
+                                         plane_t pl, struct bu_list *vlfree);
+RT_EXPORT extern int nmg_calc_face_g(struct faceuse *fu, struct bu_list 
*vlfree);
+RT_EXPORT extern fastf_t nmg_faceuse_area(const struct faceuse *fu);
+RT_EXPORT extern fastf_t nmg_shell_area(const struct shell *s);
+RT_EXPORT extern fastf_t nmg_region_area(const struct nmgregion *r);
+RT_EXPORT extern fastf_t nmg_model_area(const struct model *m);
+/* Some stray rt_ plane functions here */
+RT_EXPORT extern void nmg_purge_unwanted_intersection_points(struct bu_ptbl 
*vert_list,
+                                                             fastf_t *mag,
+                                                             const struct 
faceuse *fu,
+                                                             const struct 
bn_tol *tol);
+RT_EXPORT extern int nmg_in_or_ref(struct vertexuse *vu,
+                                   struct bu_ptbl *b);
+RT_EXPORT extern void nmg_rebound(struct model *m,
+                                  const struct bn_tol *tol);
+RT_EXPORT extern void nmg_count_shell_kids(const struct model *m,
+                                           size_t *total_wires,
+                                           size_t *total_faces,
+                                           size_t *total_points);
+RT_EXPORT extern void nmg_close_shell(struct shell *s, struct bu_list *vlfree,
+                                      const struct bn_tol *tol);
+RT_EXPORT extern struct shell *nmg_dup_shell(struct shell *s,
+                                             long ***copy_tbl,
+                                            struct bu_list *vlfree,
+                                             const struct bn_tol *tol);
+RT_EXPORT extern struct edgeuse *nmg_pop_eu(struct bu_ptbl *stack);
+RT_EXPORT extern void nmg_reverse_radials(struct faceuse *fu,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern void nmg_reverse_face_and_radials(struct faceuse *fu,
+                                                   const struct bn_tol *tol);
+RT_EXPORT extern int nmg_shell_is_void(const struct shell *s);
+RT_EXPORT extern void nmg_propagate_normals(struct faceuse *fu_in,
+                                            long *flags,
+                                            const struct bn_tol *tol);
+RT_EXPORT extern void nmg_connect_same_fu_orients(struct shell *s);
+RT_EXPORT extern void nmg_fix_decomposed_shell_normals(struct shell *s,
+                                                       const struct bn_tol 
*tol);
+RT_EXPORT extern struct model *nmg_mk_model_from_region(struct nmgregion *r,
+                                                        int reindex, struct 
bu_list *vlfree);
+RT_EXPORT extern void nmg_fix_normals(struct shell *s_orig,
+                                     struct bu_list *vlfree,
+                                      const struct bn_tol *tol);
+RT_EXPORT extern int nmg_break_long_edges(struct shell *s,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern struct faceuse *nmg_mk_new_face_from_loop(struct loopuse *lu);
+RT_EXPORT extern int nmg_split_loops_into_faces(uint32_t *magic_p, struct 
bu_list *vlfree,
+                                                const struct bn_tol *tol);
+RT_EXPORT extern int nmg_decompose_shell(struct shell *s, struct bu_list 
*vlfree,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern void nmg_stash_model_to_file(const char *filename,
+                                              const struct model *m,
+                                              const char *title);
+RT_EXPORT extern int nmg_unbreak_region_edges(uint32_t *magic_p, struct 
bu_list *vlfree);
+RT_EXPORT extern void nmg_vlist_to_eu(struct bu_list *vlist,
+                                      struct shell *s);
+RT_EXPORT extern int nmg_mv_shell_to_region(struct shell *s,
+                                            struct nmgregion *r);
+RT_EXPORT extern int nmg_find_isect_faces(const struct vertex *new_v,
+                                          struct bu_ptbl *faces,
+                                          int *free_edges,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern int nmg_simple_vertex_solve(struct vertex *new_v,
+                                             const struct bu_ptbl *faces,
+                                             const struct bn_tol *tol);
+RT_EXPORT extern int nmg_ck_vert_on_fus(const struct vertex *v,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern void nmg_make_faces_at_vert(struct vertex *new_v,
+                                             struct bu_ptbl *int_faces,
+                                            struct bu_list *vlfree,
+                                             const struct bn_tol *tol);
+RT_EXPORT extern void nmg_kill_cracks_at_vertex(const struct vertex *vp);
+RT_EXPORT extern 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);
+RT_EXPORT extern int nmg_bad_face_normals(const struct shell *s,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern int nmg_faces_are_radial(const struct faceuse *fu1,
+                                          const struct faceuse *fu2);
+RT_EXPORT extern int nmg_move_edge_thru_pt(struct edgeuse *mv_eu,
+                                           const point_t pt,
+                                           const struct bn_tol *tol);
+RT_EXPORT extern void nmg_vlist_to_wire_edges(struct shell *s,
+                                              const struct bu_list *vhead);
+RT_EXPORT extern void nmg_follow_free_edges_to_vertex(const struct vertex *vpa,
+                                                      const struct vertex *vpb,
+                                                      struct bu_ptbl 
*bad_verts,
+                                                      const struct shell *s,
+                                                      const struct edgeuse *eu,
+                                                      struct bu_ptbl *verts,
+                                                      int *found);
+RT_EXPORT extern void nmg_glue_face_in_shell(const struct faceuse *fu,
+                                             struct shell *s,
+                                             const struct bn_tol *tol);
+RT_EXPORT extern int nmg_open_shells_connect(struct shell *dst,
+                                             struct shell *src,
+                                             const long **copy_tbl,
+                                            struct bu_list *vlfree,
+                                             const struct bn_tol *tol);
+RT_EXPORT extern int nmg_in_vert(struct vertex *new_v,
+                                 const int approximate,
+                                struct bu_list *vlfree,
+                                 const struct bn_tol *tol);
+RT_EXPORT extern void nmg_mirror_model(struct model *m, struct bu_list 
*vlfree);
+RT_EXPORT extern int nmg_kill_cracks(struct shell *s);
+RT_EXPORT extern int nmg_kill_zero_length_edgeuses(struct model *m);
+RT_EXPORT extern void nmg_make_faces_within_tol(struct shell *s,
+                                               struct bu_list *vlfree,
+                                                const struct bn_tol *tol);
+RT_EXPORT extern void nmg_intersect_loops_self(struct shell *s,
+                                               const struct bn_tol *tol);
+RT_EXPORT extern struct edge_g_cnurb *nmg_join_cnurbs(struct bu_list 
*crv_head);
+RT_EXPORT extern struct edge_g_cnurb *nmg_arc2d_to_cnurb(point_t i_center,
+                                                        point_t i_start,
+                                                        point_t i_end,
+                                                        int point_type,
+                                                        const struct bn_tol 
*tol);
+RT_EXPORT extern int nmg_break_edge_at_verts(struct edge *e,
+                                             struct bu_ptbl *verts,
+                                             const struct bn_tol *tol);
+RT_EXPORT extern fastf_t nmg_loop_plane_area(const struct loopuse *lu,
+                                             plane_t pl);
+RT_EXPORT extern int nmg_break_edges(uint32_t *magic_p, struct bu_list *vlfree,
+                                     const struct bn_tol *tol);
+RT_EXPORT extern int nmg_lu_is_convex(struct loopuse *lu,
+                                     struct bu_list *vlfree,
+                                      const struct bn_tol *tol);
+RT_EXPORT extern int nmg_simplify_shell_edges(struct shell *s,
+                                              const struct bn_tol *tol);
+RT_EXPORT extern int nmg_edge_collapse(struct model *m,
+                                       const struct bn_tol *tol,
+                                       const fastf_t tol_coll,
+                                       const fastf_t min_angle,
+                                      struct bu_list *vlfree);
+
+/* From nmg_copy.c */
+RT_EXPORT extern struct model *nmg_clone_model(const struct model *original);
+
+/* From nmg_tri.c */
+RT_EXPORT extern void nmg_triangulate_shell(struct shell *s,
+                                           struct bu_list *vlfree,
+                                            const struct bn_tol  *tol);
+
+
+RT_EXPORT extern void nmg_triangulate_model(struct model *m,
+                                           struct bu_list *vlfree,
+                                            const struct bn_tol *tol);
+RT_EXPORT extern int nmg_triangulate_fu(struct faceuse *fu,
+                                       struct bu_list *vlfree,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern void nmg_dump_model(struct model *m);
+
+/* nmg_manif.c */
+RT_EXPORT extern int nmg_dangling_face(const struct faceuse *fu,
+                                       const char *manifolds);
+/* static paint_face */
+/* static set_edge_sub_manifold */
+/* static set_loop_sub_manifold */
+/* static set_face_sub_manifold */
+RT_EXPORT extern char *nmg_shell_manifolds(struct shell *sp,
+                                           char *tbl);
+RT_EXPORT extern char *nmg_manifolds(struct model *m);
+
+/* From nmg_fuse.c */
+RT_EXPORT extern int nmg_is_common_bigloop(const struct face *f1,
+                                          const struct face *f2);
+RT_EXPORT extern void nmg_region_v_unique(struct nmgregion *r1, struct bu_list 
*vlfree,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern int nmg_ptbl_vfuse(struct bu_ptbl *t,
+                                   const struct bn_tol *tol);
+RT_EXPORT extern int   nmg_region_both_vfuse(struct bu_ptbl *t1,
+                                             struct bu_ptbl *t2,
+                                             const struct bn_tol *tol);
+/* nmg_two_region_vertex_fuse replaced with nmg_vertex_fuse */
+RT_EXPORT extern int nmg_vertex_fuse(const uint32_t *magic_p,struct bu_list 
*vlfree,
+                                    const struct bn_tol *tol);
+RT_EXPORT extern int nmg_cnurb_is_linear(const struct edge_g_cnurb *cnrb);
+RT_EXPORT extern int nmg_snurb_is_planar(const struct face_g_snurb *srf,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern void nmg_eval_linear_trim_curve(const struct face_g_snurb 
*snrb,
+                                                const fastf_t uvw[3],
+                                                point_t xyz);
+RT_EXPORT extern void nmg_eval_trim_curve(const struct edge_g_cnurb *cnrb,
+                                         const struct face_g_snurb *snrb,
+                                         const fastf_t t, point_t xyz);
+/* nmg_split_trim */
+RT_EXPORT extern 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);
+/* nmg_split_linear_trim */
+RT_EXPORT extern void nmg_eval_linear_trim_to_tol(const struct edge_g_cnurb 
*cnrb,
+                                                 const struct face_g_snurb 
*snrb,
+                                                 const fastf_t uvw1[3],
+                                                 const fastf_t uvw2[3],
+                                                 struct bu_list *head,
+                                                 const struct bn_tol *tol);
+RT_EXPORT extern int nmg_cnurb_lseg_coincident(const struct edgeuse *eu1,
+                                              const struct edge_g_cnurb *cnrb,
+                                              const struct face_g_snurb *snrb,
+                                              const point_t pt1,
+                                              const point_t pt2,
+                                              const struct bn_tol *tol);
+RT_EXPORT extern 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);
+RT_EXPORT extern int nmg_edge_fuse(const uint32_t *magic_p,struct bu_list 
*vlfree,
+                                  const struct bn_tol *tol);
+RT_EXPORT extern int nmg_edge_g_fuse(const uint32_t *magic_p,struct bu_list 
*vlfree,
+                                          const struct bn_tol  *tol);
+RT_EXPORT extern int nmg_ck_fu_verts(struct faceuse *fu1,
+                                    struct face *f2,
+                                    const struct bn_tol *tol);
+RT_EXPORT extern int nmg_ck_fg_verts(struct faceuse *fu1,
+                                    struct face *f2,
+                                    const struct bn_tol *tol);
+RT_EXPORT extern int   nmg_two_face_fuse(struct face   *f1,
+                                         struct face *f2,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern int nmg_model_face_fuse(struct model *m,struct bu_list 
*vlfree,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern int nmg_break_all_es_on_v(uint32_t *magic_p,
+                                          struct vertex *v,struct bu_list 
*vlfree,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern int nmg_break_e_on_v(const uint32_t *magic_p,struct bu_list 
*vlfree,
+                                     const struct bn_tol *tol);
+/* DEPRECATED: use nmg_break_e_on_v */
+RT_EXPORT extern int nmg_model_break_e_on_v(const uint32_t *magic_p,
+                                           struct bu_list *vlfree,
+                                           const struct bn_tol *tol);
+RT_EXPORT extern int nmg_model_fuse(struct model *m,
+                                   struct bu_list *vlfree,
+                                   const struct bn_tol *tol);
+
+/* radial routines */
+RT_EXPORT extern void nmg_radial_sorted_list_insert(struct bu_list *hd,
+                                                   struct nmg_radial *rad);
+RT_EXPORT extern void nmg_radial_verify_pointers(const struct bu_list *hd,
+                                                const struct bn_tol *tol);
+RT_EXPORT extern void nmg_radial_verify_monotone(const struct bu_list  *hd,
+                                                const struct bn_tol    *tol);
+RT_EXPORT extern void nmg_insure_radial_list_is_increasing(struct bu_list      
*hd,
+                                                          fastf_t amin, 
fastf_t amax);
+RT_EXPORT extern void nmg_radial_build_list(struct bu_list             *hd,
+                                           struct bu_ptbl              
*shell_tbl,
+                                           int                 existing,
+                                           struct edgeuse              *eu,
+                                           const vect_t                xvec,
+                                           const vect_t                yvec,
+                                           const vect_t                zvec,
+                                           const struct bn_tol *tol);
+RT_EXPORT extern void nmg_radial_merge_lists(struct bu_list            *dest,
+                                            struct bu_list             *src,
+                                            const struct bn_tol        *tol);
+RT_EXPORT extern int    nmg_is_crack_outie(const struct edgeuse        *eu,
+                                           struct bu_list *vlfree,
+                                           const struct bn_tol *tol);
+RT_EXPORT extern struct nmg_radial     *nmg_find_radial_eu(const struct 
bu_list *hd,
+                                                           const struct 
edgeuse *eu);
+RT_EXPORT extern const struct edgeuse *nmg_find_next_use_of_2e_in_lu(const 
struct edgeuse      *eu,
+                                                                    const 
struct edge  *e1,
+                                                                    const 
struct edge  *e2);
+RT_EXPORT extern void nmg_radial_mark_cracks(struct bu_list    *hd,
+                                            const struct edge  *e1,
+                                            const struct edge  *e2,
+                                            struct bu_list *vlfree,
+                                            const struct bn_tol        *tol);
+RT_EXPORT extern struct nmg_radial *nmg_radial_find_an_original(const struct 
bu_list   *hd,
+                                                               const struct 
shell      *s,
+                                                               const struct 
bn_tol     *tol);
+RT_EXPORT extern int nmg_radial_mark_flips(struct bu_list              *hd,
+                                          const struct shell   *s,
+                                          const struct bn_tol  *tol);
+RT_EXPORT extern int nmg_radial_check_parity(const struct bu_list      *hd,
+                                            const struct bu_ptbl       *shells,
+                                            const struct bn_tol        *tol);
+RT_EXPORT extern void nmg_radial_implement_decisions(struct bu_list            
*hd,
+                                                    const struct bn_tol        
*tol,
+                                                    struct edgeuse             
*eu1,
+                                                    vect_t xvec,
+                                                    vect_t yvec,
+                                                    vect_t zvec);
+RT_EXPORT extern void nmg_pr_radial(const char *title,
+                                   const struct nmg_radial     *rad);
+RT_EXPORT extern void nmg_pr_radial_list(const struct bu_list *hd,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern void nmg_do_radial_flips(struct bu_list *hd);
+RT_EXPORT extern void nmg_do_radial_join(struct bu_list *hd,
+                                        struct edgeuse *eu1ref,
+                                        vect_t xvec, vect_t yvec, vect_t zvec,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern void nmg_radial_join_eu_NEW(struct edgeuse *eu1,
+                                            struct edgeuse *eu2,
+                                            const struct bn_tol *tol);
+RT_EXPORT extern void nmg_radial_exchange_marked(struct bu_list                
*hd,
+                                                const struct bn_tol    *tol);
+RT_EXPORT extern void nmg_s_radial_harmonize(struct shell              *s,
+                                            struct bu_list *vlfree,
+                                            const struct bn_tol        *tol);
+RT_EXPORT extern void nmg_s_radial_check(struct shell          *s,
+                                        struct bu_list *vlfree,
+                                        const struct bn_tol    *tol);
+RT_EXPORT extern void nmg_r_radial_check(const struct nmgregion        *r,
+                                        struct bu_list *vlfree,
+                                        const struct bn_tol    *tol);
+
+
+RT_EXPORT extern struct edge_g_lseg    *nmg_pick_best_edge_g(struct edgeuse 
*eu1,
+                                                             struct edgeuse 
*eu2,
+                                                             const struct 
bn_tol *tol);
+
+/* nmg_visit.c */
+RT_EXPORT extern void nmg_visit_vertex(struct vertex                   *v,
+                                      const struct nmg_visit_handlers  *htab,
+                                      void *                   state);
+RT_EXPORT extern void nmg_visit_vertexuse(struct vertexuse             *vu,
+                                         const struct nmg_visit_handlers       
*htab,
+                                         void *                        state);
+RT_EXPORT extern void nmg_visit_edge(struct edge                       *e,
+                                    const struct nmg_visit_handlers    *htab,
+                                    void *                     state);
+RT_EXPORT extern void nmg_visit_edgeuse(struct edgeuse                 *eu,
+                                       const struct nmg_visit_handlers *htab,
+                                       void *                  state);
+RT_EXPORT extern void nmg_visit_loop(struct loop                       *l,
+                                    const struct nmg_visit_handlers    *htab,
+                                    void *                     state);
+RT_EXPORT extern void nmg_visit_loopuse(struct loopuse                 *lu,
+                                       const struct nmg_visit_handlers *htab,
+                                       void *                  state);
+RT_EXPORT extern void nmg_visit_face(struct face                       *f,
+                                    const struct nmg_visit_handlers    *htab,
+                                    void *                     state);
+RT_EXPORT extern void nmg_visit_faceuse(struct faceuse                 *fu,
+                                       const struct nmg_visit_handlers *htab,
+                                       void *                  state,
+                                       struct bu_list *vlfree);
+RT_EXPORT extern void nmg_visit_shell(struct shell                     *s,
+                                     const struct nmg_visit_handlers   *htab,
+                                     void *                    state,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_visit_region(struct nmgregion                *r,
+                                      const struct nmg_visit_handlers  *htab,
+                                      void *                   state,
+                                      struct bu_list *vlfree);
+RT_EXPORT extern void nmg_visit_model(struct model                     *model,
+                                     const struct nmg_visit_handlers   *htab,
+                                     void *                    state,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_visit(const uint32_t         *magicp,
+                               const struct nmg_visit_handlers *htab,
+                               void *                  state,
+                               struct bu_list *vlfree);
+
+
+/* nmg_class.c */
+RT_EXPORT extern int nmg_classify_pt_loop(const point_t pt,
+                                          const struct loopuse *lu,
+                                         struct bu_list *vlfree,
+                                          const struct bn_tol *tol);
+
+RT_EXPORT extern int nmg_classify_s_vs_s(struct shell *s,
+                                         struct shell *s2,
+                                        struct bu_list *vlfree,
+                                         const struct bn_tol *tol);
+
+RT_EXPORT extern int nmg_classify_lu_lu(const struct loopuse *lu1,
+                                        const struct loopuse *lu2,
+                                       struct bu_list *vlfree,
+                                        const struct bn_tol *tol);
+
+RT_EXPORT extern int nmg_class_pt_f(const point_t pt,
+                                    const struct faceuse *fu,
+                                    const struct bn_tol *tol);
+RT_EXPORT extern int nmg_class_pt_s(const point_t pt,
+                                    const struct shell *s,
+                                    const int in_or_out_only,
+                                   struct bu_list *vlfree,
+                                    const struct bn_tol *tol);
+
+/* From nmg_pt_fu.c */
+RT_EXPORT extern int nmg_eu_is_part_of_crack(const struct edgeuse *eu);
+
+RT_EXPORT extern int nmg_class_pt_lu_except(point_t             pt,
+                                            const struct loopuse        *lu,
+                                            const struct edge           *e_p,
+                                           struct bu_list *vlfree,
+                                            const struct bn_tol *tol);
+
+RT_EXPORT extern int nmg_class_pt_fu_except(const point_t pt,
+                                            const struct faceuse *fu,
+                                            const struct loopuse *ignore_lu,
+                                            void (*eu_func)(struct edgeuse *, 
point_t, const char *),
+                                            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);
+
+/* From nmg_plot.c */
+RT_EXPORT extern void nmg_pl_shell(FILE *fp,
+                                   const struct shell *s,
+                                   int fancy,
+                                  struct bu_list *vlfree);
+
+RT_EXPORT extern void nmg_vu_to_vlist(struct bu_list *vhead,
+                                      const struct vertexuse    *vu,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_eu_to_vlist(struct bu_list *vhead,
+                                      const struct bu_list      *eu_hd,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_lu_to_vlist(struct bu_list *vhead,
+                                      const struct loopuse      *lu,
+                                      int                       poly_markers,
+                                      const vectp_t             norm,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_snurb_fu_to_vlist(struct bu_list              *vhead,
+                                            const struct faceuse        *fu,
+                                            int                 poly_markers,
+                                           struct bu_list *vlfree);
+RT_EXPORT extern void nmg_s_to_vlist(struct bu_list             *vhead,
+                                     const struct shell *s,
+                                     int                        poly_markers,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_r_to_vlist(struct bu_list             *vhead,
+                                     const struct nmgregion     *r,
+                                     int                        poly_markers,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_m_to_vlist(struct bu_list     *vhead,
+                                     struct model       *m,
+                                     int                poly_markers,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_offset_eu_vert(point_t                        base,
+                                         const struct edgeuse   *eu,
+                                         const vect_t           face_normal,
+                                         int                    tip);
+/* plot */
+RT_EXPORT extern void nmg_pl_v(FILE     *fp,
+                               const struct vertex *v,
+                               long *b);
+RT_EXPORT extern void nmg_pl_e(FILE *fp,
+                               const struct edge *e,
+                               long *b,
+                               int red,
+                               int green,
+                               int blue);
+RT_EXPORT extern void nmg_pl_eu(FILE *fp,
+                                const struct edgeuse *eu,
+                                long *b,
+                                int red,
+                                int green,
+                                int blue);
+RT_EXPORT extern void nmg_pl_lu(FILE *fp,
+                                const struct loopuse *fu,
+                                long *b,
+                                int red,
+                                int green,
+                                int blue,
+                               struct bu_list *vlfree);
+RT_EXPORT extern void nmg_pl_fu(FILE *fp,
+                                const struct faceuse *fu,
+                                long *b,
+                                int red,
+                                int green,
+                                int blue,
+                               struct bu_list *vlfree);
+RT_EXPORT extern void nmg_pl_s(FILE *fp,
+                               const struct shell *s,
+                              struct bu_list *vlfree);
+RT_EXPORT extern void nmg_pl_r(FILE *fp,
+                               const struct nmgregion *r,
+                              struct bu_list *vlfree);
+RT_EXPORT extern void nmg_pl_m(FILE *fp,
+                               const struct model *m,
+                              struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_v(struct bn_vlblock *vbp,
+                                    const struct vertex *v,
+                                    long *tab,
+                                   struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_e(struct bn_vlblock *vbp,
+                                    const struct edge *e,
+                                    long *tab,
+                                    int red,
+                                    int green,
+                                    int blue,
+                                   struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_eu(struct bn_vlblock *vbp,
+                                     const struct edgeuse *eu,
+                                     long *tab,
+                                     int red,
+                                     int green,
+                                     int blue,
+                                     int fancy,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_euleft(struct bu_list                 *vh,
+                                         const struct edgeuse           *eu,
+                                         const point_t                  center,
+                                         const mat_t                    mat,
+                                         const vect_t                   xvec,
+                                         const vect_t                   yvec,
+                                         double                         len,
+                                        struct bu_list                 *vlfree,
+                                         const struct bn_tol            *tol);
+RT_EXPORT extern void nmg_vlblock_around_eu(struct bn_vlblock           *vbp,
+                                            const struct edgeuse        
*arg_eu,
+                                            long                        *tab,
+                                            int                 fancy,
+                                           struct bu_list *vlfree,
+                                            const struct bn_tol *tol);
+RT_EXPORT extern void nmg_vlblock_lu(struct bn_vlblock *vbp,
+                                     const struct loopuse *lu,
+                                     long *tab,
+                                     int red,
+                                     int green,
+                                     int blue,
+                                     int fancy,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_fu(struct bn_vlblock *vbp,
+                                     const struct faceuse *fu,
+                                     long *tab, int fancy, struct bu_list 
*vlfree);
+RT_EXPORT extern void nmg_vlblock_s(struct bn_vlblock *vbp,
+                                    const struct shell *s,
+                                    int fancy,
+                                   struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_r(struct bn_vlblock *vbp,
+                                    const struct nmgregion *r,
+                                    int fancy,
+                                   struct bu_list *vlfree);
+RT_EXPORT extern void nmg_vlblock_m(struct bn_vlblock *vbp,
+                                    const struct model *m,
+                                    int fancy,
+                                   struct bu_list *vlfree);
+
+/* visualization helper routines */
+RT_EXPORT extern void nmg_pl_edges_in_2_shells(struct bn_vlblock        *vbp,
+                                               long                     *b,
+                                               const struct edgeuse     *eu,
+                                               int                      fancy,
+                                              struct bu_list *vlfree,
+                                               const struct bn_tol      *tol);
+RT_EXPORT extern void nmg_pl_isect(const char           *filename,
+                                   const struct shell   *s,
+                                  struct bu_list *vlfree,
+                                   const struct bn_tol  *tol);
+RT_EXPORT extern void nmg_pl_comb_fu(int num1,
+                                     int num2,
+                                     const struct faceuse *fu1,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_pl_2fu(const char *str,
+                                 const struct faceuse *fu1,
+                                 const struct faceuse *fu2,
+                                 int show_mates,
+                                struct bu_list *vlfree);
+/* graphical display of classifier results */
+RT_EXPORT extern void nmg_show_broken_classifier_stuff(uint32_t *p,
+                                                       char     **classlist,
+                                                       int      all_new,
+                                                       int      fancy,
+                                                       const char       
*a_string,
+                                                      struct bu_list *vlfree);
+RT_EXPORT extern void nmg_face_plot(const struct faceuse *fu, struct bu_list 
*vlfree);
+RT_EXPORT extern void nmg_2face_plot(const struct faceuse *fu1,
+                                     const struct faceuse *fu2,
+                                    struct bu_list *vlfree);
+RT_EXPORT extern void nmg_face_lu_plot(const struct loopuse *lu,
+                                       const struct vertexuse *vu1,
+                                       const struct vertexuse *vu2,
+                                      struct bu_list *vlfree);
+RT_EXPORT extern void nmg_plot_lu_ray(const struct loopuse              *lu,
+                                      const struct vertexuse            *vu1,
+                                      const struct vertexuse            *vu2,
+                                      const vect_t                      left,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_plot_ray_face(const char *fname,
+                                        point_t pt,
+                                        const vect_t dir,
+                                        const struct faceuse *fu,
+                                       struct bu_list *vlfree);
+RT_EXPORT extern void nmg_plot_lu_around_eu(const char          *prefix,
+                                            const struct edgeuse        *eu,
+                                           struct bu_list *vlfree,
+                                            const struct bn_tol *tol);
+RT_EXPORT extern int nmg_snurb_to_vlist(struct bu_list          *vhead,
+                                        const struct face_g_snurb       *fg,
+                                        int                     n_interior,
+                                       struct bu_list *vlfree);
+RT_EXPORT extern void nmg_cnurb_to_vlist(struct bu_list *vhead,
+                                         const struct edgeuse *eu,
+                                         int n_interior,
+                                        int cmd,
+                                        struct bu_list *vlfree);
+
+/**
+ * edge use distance tolerance
+ */
+RT_EXPORT extern double nmg_eue_dist;
+
+
+/* from nmg_mesh.c */
+RT_EXPORT extern int nmg_mesh_two_faces(struct faceuse *fu1,
+                                        struct faceuse *fu2,
+                                        const struct bn_tol     *tol);
+RT_EXPORT extern void nmg_radial_join_eu(struct edgeuse *eu1,
+                                         struct edgeuse *eu2,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern void nmg_mesh_faces(struct faceuse *fu1,
+                                     struct faceuse *fu2,
+                                    struct bu_list *vlfree,
+                                    const struct bn_tol *tol);
+RT_EXPORT extern int nmg_mesh_face_shell(struct faceuse *fu1,
+                                         struct shell *s,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern int nmg_mesh_shell_shell(struct shell *s1,
+                                          struct shell *s2,
+                                         struct bu_list *vlfree,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern double nmg_measure_fu_angle(const struct edgeuse *eu,
+                                             const vect_t xvec,
+                                             const vect_t yvec,
+                                             const vect_t zvec);
+
+/* from nmg_bool.c */
+RT_EXPORT extern struct nmgregion *nmg_do_bool(struct nmgregion *s1,
+                                               struct nmgregion *s2,
+                                               const int oper, struct bu_list 
*vlfree, const struct bn_tol *tol);
+RT_EXPORT extern int nmg_two_region_vertex_fuse(struct nmgregion *r1,
+                                                struct nmgregion *r2,
+                                                const struct bn_tol *tol);
+
+
+/* from nmg_class.c */
+RT_EXPORT extern void nmg_class_shells(struct shell *sA,
+                                       struct shell *sB,
+                                       char **classlist,
+                                      struct bu_list *vlfree,
+                                       const struct bn_tol *tol);
+
+/* from nmg_fcut.c */
+/* static void ptbl_vsort */
+RT_EXPORT extern int nmg_ck_vu_ptbl(struct bu_ptbl      *p,
+                                    struct faceuse      *fu);
+RT_EXPORT extern double nmg_vu_angle_measure(struct vertexuse   *vu,
+                                             vect_t x_dir,
+                                             vect_t y_dir,
+                                             int assessment,
+                                             int in);
+RT_EXPORT extern int nmg_wedge_class(int        ass,    /* assessment of two 
edges forming wedge */
+                                     double     a,
+                                     double     b);
+RT_EXPORT extern void nmg_sanitize_fu(struct faceuse    *fu);
+RT_EXPORT extern void nmg_unlist_v(struct bu_ptbl       *b,
+                                   fastf_t *mag,
+                                   struct vertex        *v);
+RT_EXPORT extern 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);
+RT_EXPORT extern 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);
+RT_EXPORT extern int nmg_insert_vu_if_on_edge(struct vertexuse *vu1,
+                                              struct vertexuse *vu2,
+                                              struct edgeuse *new_eu,
+                                              struct bn_tol *tol);
+/* nmg_face_state_transition */
+
+#define nmg_mev(_v, _u) nmg_me((_v), (struct vertex *)NULL, (_u))
+
+/* From nmg_eval.c */
+RT_EXPORT extern void nmg_ck_lu_orientation(struct loopuse *lu,
+                                            const struct bn_tol *tolp);
+RT_EXPORT extern const char *nmg_class_name(int class_no);
+RT_EXPORT extern void nmg_evaluate_boolean(struct shell *sA,
+                                           struct shell *sB,
+                                           int          op,
+                                           char         **classlist,
+                                          struct bu_list *vlfree,
+                                           const struct bn_tol  *tol);
+
+/* The following functions cannot be publicly declared because struct
+ * nmg_bool_state is private to nmg_eval.c
+ */
+/* nmg_eval_shell */
+/* nmg_eval_action */
+/* nmg_eval_plot */
+
+/* From nmg_ck.c */
+RT_EXPORT extern void nmg_vvg(const struct vertex_g *vg);
+RT_EXPORT extern void nmg_vvertex(const struct vertex *v,
+                                  const struct vertexuse *vup);
+RT_EXPORT extern void nmg_vvua(const uint32_t *vua);
+RT_EXPORT extern void nmg_vvu(const struct vertexuse *vu,
+                              const uint32_t *up_magic_p);
+RT_EXPORT extern void nmg_veg(const uint32_t *eg);
+RT_EXPORT extern void nmg_vedge(const struct edge *e,
+                                const struct edgeuse *eup);
+RT_EXPORT extern void nmg_veu(const struct bu_list      *hp,
+                              const uint32_t *up_magic_p);
+RT_EXPORT extern void nmg_vlg(const struct loop_g *lg);
+RT_EXPORT extern void nmg_vloop(const struct loop *l,
+                                const struct loopuse *lup);
+RT_EXPORT extern void nmg_vlu(const struct bu_list      *hp,
+                              const uint32_t *up);
+RT_EXPORT extern void nmg_vfg(const struct face_g_plane *fg);
+RT_EXPORT extern void nmg_vface(const struct face *f,
+                                const struct faceuse *fup);
+RT_EXPORT extern void nmg_vfu(const struct bu_list      *hp,
+                              const struct shell *s);
+RT_EXPORT extern void nmg_vsshell(const struct shell *s,
+                                 const struct nmgregion *r);
+RT_EXPORT extern void nmg_vshell(const struct bu_list *hp,
+                                 const struct nmgregion *r);
+RT_EXPORT extern void nmg_vregion(const struct bu_list *hp,
+                                  const struct model *m);
+RT_EXPORT extern void nmg_vmodel(const struct model *m);
+
+/* checking routines */
+RT_EXPORT extern void nmg_ck_e(const struct edgeuse *eu,
+                               const struct edge *e,
+                               const char *str);
+RT_EXPORT extern void nmg_ck_vu(const uint32_t *parent,
+                                const struct vertexuse *vu,
+                                const char *str);
+RT_EXPORT extern void nmg_ck_eu(const uint32_t *parent,
+                                const struct edgeuse *eu,
+                                const char *str);
+RT_EXPORT extern void nmg_ck_lg(const struct loop *l,
+                                const struct loop_g *lg,
+                                const char *str);
+RT_EXPORT extern void nmg_ck_l(const struct loopuse *lu,
+                               const struct loop *l,
+                               const char *str);
+RT_EXPORT extern void nmg_ck_lu(const uint32_t *parent,
+                                const struct loopuse *lu,
+                                const char *str);
+RT_EXPORT extern void nmg_ck_fg(const struct face *f,
+                                const struct face_g_plane *fg,
+                                const char *str);
+RT_EXPORT extern void nmg_ck_f(const struct faceuse *fu,
+                               const struct face *f,
+                               const char *str);
+RT_EXPORT extern void nmg_ck_fu(const struct shell *s,
+                                const struct faceuse *fu,
+                                const char *str);
+RT_EXPORT extern int nmg_ck_eg_verts(const struct edge_g_lseg *eg,
+                                     const struct bn_tol *tol);
+RT_EXPORT extern size_t nmg_ck_geometry(const struct model *m,
+                                       struct bu_list *vlfree,
+                                       const struct bn_tol *tol);
+RT_EXPORT extern int nmg_ck_face_worthless_edges(const struct faceuse *fu);
+RT_EXPORT extern void nmg_ck_lueu(const struct loopuse *lu, const char *s);
+RT_EXPORT extern int nmg_check_radial(const struct edgeuse *eu, const struct 
bn_tol *tol);
+RT_EXPORT extern int nmg_eu_2s_orient_bad(const struct edgeuse  *eu,
+                                          const struct shell    *s1,
+                                          const struct shell    *s2,
+                                          const struct bn_tol   *tol);
+RT_EXPORT extern int nmg_ck_closed_surf(const struct shell *s,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern int nmg_ck_closed_region(const struct nmgregion *r,
+                                          const struct bn_tol *tol);
+RT_EXPORT extern void nmg_ck_v_in_2fus(const struct vertex *vp,
+                                       const struct faceuse *fu1,
+                                       const struct faceuse *fu2,
+                                       const struct bn_tol *tol);
+RT_EXPORT extern void nmg_ck_vs_in_region(const struct nmgregion *r,
+                                         struct bu_list *vlfree,
+                                          const struct bn_tol *tol);
+
+
+/* From nmg_inter.c */
+RT_EXPORT extern struct vertexuse *nmg_make_dualvu(struct vertex *v,
+                                                   struct faceuse *fu,
+                                                   const struct bn_tol *tol);
+RT_EXPORT extern struct vertexuse *nmg_enlist_vu(struct nmg_inter_struct       
 *is,
+                                                 const struct vertexuse *vu,
+                                                 struct vertexuse *dualvu,
+                                                 fastf_t dist);
+RT_EXPORT extern void nmg_isect2d_prep(struct nmg_inter_struct *is,
+                                       const uint32_t *assoc_use);
+RT_EXPORT extern void nmg_isect2d_cleanup(struct nmg_inter_struct *is);
+RT_EXPORT extern void nmg_isect2d_final_cleanup(void);
+RT_EXPORT extern int nmg_isect_2faceuse(point_t pt,
+                                        vect_t dir,
+                                        struct faceuse *fu1,
+                                        struct faceuse *fu2,
+                                        const struct bn_tol *tol);
+RT_EXPORT extern void nmg_isect_vert2p_face2p(struct nmg_inter_struct *is,
+                                              struct vertexuse *vu1,
+                                              struct faceuse *fu2);
+RT_EXPORT extern struct edgeuse *nmg_break_eu_on_v(struct edgeuse *eu1,
+                                                   struct vertex *v2,
+                                                   struct faceuse *fu,
+                                                   struct nmg_inter_struct 
*is);
+RT_EXPORT extern void nmg_break_eg_on_v(const struct edge_g_lseg        *eg,
+                                        struct vertex           *v,
+                                        const struct bn_tol     *tol);
+RT_EXPORT extern int nmg_isect_2colinear_edge2p(struct edgeuse  *eu1,
+                                                struct edgeuse  *eu2,
+                                                struct faceuse          *fu,
+                                                struct nmg_inter_struct *is,
+                                                struct bu_ptbl          *l1,
+                                                struct bu_ptbl          *l2);
+RT_EXPORT extern int nmg_isect_edge2p_edge2p(struct nmg_inter_struct    *is,
+                                             struct edgeuse             *eu1,
+                                             struct edgeuse             *eu2,
+                                             struct faceuse             *fu1,
+                                             struct faceuse             *fu2);
+RT_EXPORT extern int nmg_isect_construct_nice_ray(struct nmg_inter_struct      
 *is,
+                                                  struct faceuse               
 *fu2);
+RT_EXPORT extern void nmg_enlist_one_vu(struct nmg_inter_struct *is,
+                                        const struct vertexuse  *vu,
+                                        fastf_t                 dist);
+RT_EXPORT extern int    nmg_isect_line2_edge2p(struct nmg_inter_struct  *is,
+                                               struct bu_ptbl           *list,
+                                               struct edgeuse           *eu1,
+                                               struct faceuse           *fu1,
+                                               struct faceuse           *fu2);
+RT_EXPORT extern void nmg_isect_line2_vertex2(struct nmg_inter_struct   *is,
+                                              struct vertexuse  *vu1,
+                                              struct faceuse            *fu1);
+RT_EXPORT extern int nmg_isect_two_ptbls(struct nmg_inter_struct        *is,
+                                         const struct bu_ptbl   *t1,
+                                         const struct bu_ptbl   *t2);
+RT_EXPORT extern struct edge_g_lseg     *nmg_find_eg_on_line(const uint32_t 
*magic_p,
+                                                             const point_t     
         pt,
+                                                             const vect_t      
         dir,
+                                                            struct bu_list 
*vlfree,
+                                                             const struct 
bn_tol        *tol);
+RT_EXPORT extern int nmg_k0eu(struct vertex     *v);
+RT_EXPORT extern struct vertex *nmg_repair_v_near_v(struct vertex              
 *hit_v,
+                                                    struct vertex              
 *v,
+                                                    const struct edge_g_lseg   
 *eg1,
+                                                    const struct edge_g_lseg   
 *eg2,
+                                                    int                 bomb,
+                                                    const struct bn_tol *tol);
+RT_EXPORT extern struct vertex *nmg_search_v_eg(const struct edgeuse    *eu,
+                                                int                     second,
+                                                const struct edge_g_lseg       
 *eg1,
+                                                const struct edge_g_lseg       
 *eg2,
+                                                struct vertex           *hit_v,
+                                                const struct bn_tol     *tol);
+RT_EXPORT extern struct vertex *nmg_common_v_2eg(struct edge_g_lseg     *eg1,
+                                                 struct edge_g_lseg     *eg2,
+                                                 const struct bn_tol    *tol);
+RT_EXPORT extern int nmg_is_vertex_on_inter(struct vertex *v,
+                                            struct faceuse *fu1,
+                                            struct faceuse *fu2,
+                                            struct nmg_inter_struct *is,
+                                           struct bu_list *vlfree);
+RT_EXPORT extern void nmg_isect_eu_verts(struct edgeuse *eu,
+                                         struct vertex_g *vg1,
+                                         struct vertex_g *vg2,
+                                         struct bu_ptbl *verts,
+                                         struct bu_ptbl *inters,
+                                         const struct bn_tol *tol);
+RT_EXPORT extern void nmg_isect_eu_eu(struct edgeuse *eu1,
+                                      struct vertex_g *vg1a,
+                                      struct vertex_g *vg1b,
+                                      vect_t dir1,
+                                      struct edgeuse *eu2,
+                                      struct bu_ptbl *verts,
+                                      struct bu_ptbl *inters,
+                                      const struct bn_tol *tol);
+RT_EXPORT extern void nmg_isect_eu_fu(struct nmg_inter_struct *is,
+                                      struct bu_ptbl            *verts,
+                                      struct edgeuse            *eu,
+                                      struct faceuse          *fu,
+                                     struct bu_list *vlfree);
+RT_EXPORT extern void nmg_isect_fu_jra(struct nmg_inter_struct  *is,
+                                       struct faceuse           *fu1,
+                                       struct faceuse           *fu2,
+                                       struct bu_ptbl           *eu1_list,
+                                       struct bu_ptbl           *eu2_list,
+                                      struct bu_list *vlfree);
+RT_EXPORT extern void nmg_isect_line2_face2pNEW(struct nmg_inter_struct *is,
+                                                struct faceuse *fu1, struct 
faceuse *fu2,
+                                                struct bu_ptbl *eu1_list,
+                                                struct bu_ptbl *eu2_list,
+                                               struct bu_list *vlfree);
+RT_EXPORT extern int    nmg_is_eu_on_line3(const struct edgeuse *eu,
+                                           const point_t                pt,
+                                           const vect_t         dir,
+                                           const struct bn_tol  *tol);
+RT_EXPORT extern struct edge_g_lseg     *nmg_find_eg_between_2fg(const struct 
faceuse   *ofu1,
+                                                                 const struct 
faceuse   *fu2,
+                                                                struct bu_list 
*vlfree,
+                                                                 const struct 
bn_tol    *tol);
+RT_EXPORT extern struct edgeuse *nmg_does_fu_use_eg(const struct faceuse       
 *fu1,
+                                                    const uint32_t      *eg);
+RT_EXPORT extern int rt_line_on_plane(const point_t     pt,
+                                      const vect_t      dir,
+                                      const plane_t     plane,
+                                      const struct bn_tol       *tol);
+RT_EXPORT extern void nmg_cut_lu_into_coplanar_and_non(struct loopuse *lu,
+                                                       plane_t pl,
+                                                       struct nmg_inter_struct 
*is,
+                                                      struct bu_list *vlfree);
+RT_EXPORT extern void nmg_check_radial_angles(char *str,
+                                              struct shell *s,
+                                             struct bu_list *vlfree,
+                                              const struct bn_tol *tol);
+RT_EXPORT extern int nmg_faces_can_be_intersected(struct nmg_inter_struct *bs,
+                                                  const struct faceuse *fu1,
+                                                  const struct faceuse *fu2,
+                                                 struct bu_list *vlfree,
+                                                  const struct bn_tol *tol);
+RT_EXPORT extern void nmg_isect_two_generic_faces(struct faceuse               
 *fu1,
+                                                  struct faceuse               
 *fu2,
+                                                 struct bu_list *vlfree,
+                                                  const struct bn_tol   *tol);
+RT_EXPORT extern void nmg_crackshells(struct shell *s1,
+                                      struct shell *s2,
+                                     struct bu_list *vlfree,
+                                     const struct bn_tol *tol);
+RT_EXPORT extern int nmg_fu_touchingloops(const struct faceuse *fu);
+
+
+/* From nmg_index.c */
+RT_EXPORT extern int nmg_index_of_struct(const uint32_t *p);
+RT_EXPORT extern void nmg_m_set_high_bit(struct model *m);
+RT_EXPORT extern void nmg_m_reindex(struct model *m, long newindex);
+RT_EXPORT extern void nmg_vls_struct_counts(struct bu_vls *str,
+                                            const struct nmg_struct_counts 
*ctr);
+RT_EXPORT extern void nmg_pr_struct_counts(const struct nmg_struct_counts *ctr,
+                                           const char *str);
+RT_EXPORT extern uint32_t **nmg_m_struct_count(struct nmg_struct_counts *ctr,
+                                                    const struct model *m);
+RT_EXPORT extern void nmg_pr_m_struct_counts(const struct model *m,
+                                             const char         *str);
+RT_EXPORT extern void nmg_merge_models(struct model *m1,
+                                       struct model *m2);
+RT_EXPORT extern long nmg_find_max_index(const struct model *m);
+
+
+
+__END_DECLS
+
 #endif /* NMG_H */
 
 /** @} */

Modified: brlcad/trunk/include/rt/nmg.h
===================================================================
--- brlcad/trunk/include/rt/nmg.h       2016-10-14 22:05:17 UTC (rev 69069)
+++ brlcad/trunk/include/rt/nmg.h       2016-10-15 15:42:28 UTC (rev 69070)
@@ -37,8 +37,6 @@
 
 __BEGIN_DECLS
 
-RT_EXPORT extern uint32_t nmg_debug;      /**< @brief  debug bits for NMG's 
see nmg.h */
-
 
/*********************************************************************************
  *      The following section is an exact copy of what was previously 
"nmg_rt.h" *
  *      (with minor changes to NMG_GET_HITMISS and NMG_FREE_HITLIST            
  *
@@ -244,282 +242,6 @@
     }
 #endif
 
-struct nmg_radial {
-    struct bu_list      l;
-    struct edgeuse      *eu;
-    struct faceuse      *fu;            /**< @brief  Derived from eu */
-    struct shell        *s;             /**< @brief  Derived from eu */
-    int                 existing_flag;  /**< @brief  !0 if this eu exists on 
dest edge */
-    int                 is_crack;       /**< @brief  This eu is part of a 
crack. */
-    int                 is_outie;       /**< @brief  This crack is an "outie" 
*/
-    int                 needs_flip;     /**< @brief  Insert eumate, not eu */
-    fastf_t             ang;            /**< @brief  angle, in radians.  0 to 
2pi */
-};
-#define NMG_CK_RADIAL(_p) NMG_CKMAG(_p, NMG_RADIAL_MAGIC, "nmg_radial")
-
-struct nmg_inter_struct {
-    uint32_t            magic;
-    struct bu_ptbl      *l1;            /**< @brief  vertexuses on the line of 
*/
-    struct bu_ptbl      *l2;            /**< @brief  intersection between 
planes */
-    fastf_t             *mag1;          /**< @brief  Distances along 
intersection line */
-    fastf_t             *mag2;          /**< @brief  for each vertexuse in l1 
and l2. */
-    size_t              mag_len;        /**< @brief  Array size of mag1 and 
mag2 */
-    struct shell        *s1;
-    struct shell        *s2;
-    struct faceuse      *fu1;           /**< @brief  null if l1 comes from a 
wire */
-    struct faceuse      *fu2;           /**< @brief  null if l2 comes from a 
wire */
-    struct bn_tol       tol;
-    int                 coplanar;       /**< @brief  a flag */
-    struct edge_g_lseg  *on_eg;         /**< @brief  edge_g for line of 
intersection */
-    point_t             pt;             /**< @brief  3D line of intersection */
-    vect_t              dir;
-    point_t             pt2d;           /**< @brief  2D projection of isect 
line */
-    vect_t              dir2d;
-    fastf_t             *vert2d;        /**< @brief  Array of 2d vertex 
projections [index] */
-    size_t              maxindex;       /**< @brief  size of vert2d[] */
-    mat_t               proj;           /**< @brief  Matrix to project onto XY 
plane */
-    const uint32_t      *twod;          /**< @brief  ptr to face/edge of 2d 
projection */
-};
-#define NMG_CK_INTER_STRUCT(_p) NMG_CKMAG(_p, NMG_INTER_STRUCT_MAGIC, 
"nmg_inter_struct")
-
-/* nmg_class.c */
-RT_EXPORT extern int nmg_classify_pt_loop(const point_t pt,
-                                          const struct loopuse *lu,
-                                         struct bu_list *vlfree,
-                                          const struct bn_tol *tol);
-
-RT_EXPORT extern int nmg_classify_s_vs_s(struct shell *s,
-                                         struct shell *s2,
-                                        struct bu_list *vlfree,
-                                         const struct bn_tol *tol);
-
-RT_EXPORT extern int nmg_classify_lu_lu(const struct loopuse *lu1,
-                                        const struct loopuse *lu2,
-                                       struct bu_list *vlfree,
-                                        const struct bn_tol *tol);
-
-RT_EXPORT extern int nmg_class_pt_f(const point_t pt,
-                                    const struct faceuse *fu,
-                                    const struct bn_tol *tol);
-RT_EXPORT extern int nmg_class_pt_s(const point_t pt,
-                                    const struct shell *s,
-                                    const int in_or_out_only,
-                                   struct bu_list *vlfree,
-                                    const struct bn_tol *tol);
-
-/* From nmg_pt_fu.c */
-RT_EXPORT extern int nmg_eu_is_part_of_crack(const struct edgeuse *eu);
-
-RT_EXPORT extern int nmg_class_pt_lu_except(point_t             pt,
-                                            const struct loopuse        *lu,
-                                            const struct edge           *e_p,
-                                           struct bu_list *vlfree,
-                                            const struct bn_tol *tol);
-
-RT_EXPORT extern int nmg_class_pt_fu_except(const point_t pt,
-                                            const struct faceuse *fu,
-                                            const struct loopuse *ignore_lu,
-                                            void (*eu_func)(struct edgeuse *, 
point_t, const char *),
-                                            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);
-
-/* From nmg_plot.c */
-RT_EXPORT extern void nmg_pl_shell(FILE *fp,
-                                   const struct shell *s,
-                                   int fancy,
-                                  struct bu_list *vlfree);
-
-RT_EXPORT extern void nmg_vu_to_vlist(struct bu_list *vhead,
-                                      const struct vertexuse    *vu,
-                                     struct bu_list *vlfree);
-RT_EXPORT extern void nmg_eu_to_vlist(struct bu_list *vhead,
-                                      const struct bu_list      *eu_hd,
-                                     struct bu_list *vlfree);
-RT_EXPORT extern void nmg_lu_to_vlist(struct bu_list *vhead,
-                                      const struct loopuse      *lu,
-                                      int                       poly_markers,
-                                      const vectp_t             norm,
-                                     struct bu_list *vlfree);
-RT_EXPORT extern void nmg_snurb_fu_to_vlist(struct bu_list              *vhead,
-                                            const struct faceuse        *fu,
-                                            int                 poly_markers,
-                                           struct bu_list *vlfree);
-RT_EXPORT extern void nmg_s_to_vlist(struct bu_list             *vhead,
-                                     const struct shell *s,
-                                     int                        poly_markers,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_r_to_vlist(struct bu_list             *vhead,
-                                     const struct nmgregion     *r,
-                                     int                        poly_markers,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_m_to_vlist(struct bu_list     *vhead,
-                                     struct model       *m,
-                                     int                poly_markers,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_offset_eu_vert(point_t                        base,
-                                         const struct edgeuse   *eu,
-                                         const vect_t           face_normal,
-                                         int                    tip);
-/* plot */
-RT_EXPORT extern void nmg_pl_v(FILE     *fp,
-                               const struct vertex *v,
-                               long *b);
-RT_EXPORT extern void nmg_pl_e(FILE *fp,
-                               const struct edge *e,
-                               long *b,
-                               int red,
-                               int green,
-                               int blue);
-RT_EXPORT extern void nmg_pl_eu(FILE *fp,
-                                const struct edgeuse *eu,
-                                long *b,
-                                int red,
-                                int green,
-                                int blue);
-RT_EXPORT extern void nmg_pl_lu(FILE *fp,
-                                const struct loopuse *fu,
-                                long *b,
-                                int red,
-                                int green,
-                                int blue,
-                               struct bu_list *vlfree);
-RT_EXPORT extern void nmg_pl_fu(FILE *fp,
-                                const struct faceuse *fu,
-                                long *b,
-                                int red,
-                                int green,
-                                int blue,
-                               struct bu_list *vlfree);
-RT_EXPORT extern void nmg_pl_s(FILE *fp,
-                               const struct shell *s,
-                              struct bu_list *vlfree);
-RT_EXPORT extern void nmg_pl_r(FILE *fp,
-                               const struct nmgregion *r,
-                              struct bu_list *vlfree);
-RT_EXPORT extern void nmg_pl_m(FILE *fp,
-                               const struct model *m,
-                              struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_v(struct bn_vlblock *vbp,
-                                    const struct vertex *v,
-                                    long *tab,
-                                   struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_e(struct bn_vlblock *vbp,
-                                    const struct edge *e,
-                                    long *tab,
-                                    int red,
-                                    int green,
-                                    int blue,
-                                   struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_eu(struct bn_vlblock *vbp,
-                                     const struct edgeuse *eu,
-                                     long *tab,
-                                     int red,
-                                     int green,
-                                     int blue,
-                                     int fancy,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_euleft(struct bu_list                 *vh,
-                                         const struct edgeuse           *eu,
-                                         const point_t                  center,
-                                         const mat_t                    mat,
-                                         const vect_t                   xvec,
-                                         const vect_t                   yvec,
-                                         double                         len,
-                                        struct bu_list                 *vlfree,
-                                         const struct bn_tol            *tol);
-RT_EXPORT extern void nmg_vlblock_around_eu(struct bn_vlblock           *vbp,
-                                            const struct edgeuse        
*arg_eu,
-                                            long                        *tab,
-                                            int                 fancy,
-                                           struct bu_list *vlfree,
-                                            const struct bn_tol *tol);
-RT_EXPORT extern void nmg_vlblock_lu(struct bn_vlblock *vbp,
-                                     const struct loopuse *lu,
-                                     long *tab,
-                                     int red,
-                                     int green,
-                                     int blue,
-                                     int fancy,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_fu(struct bn_vlblock *vbp,
-                                     const struct faceuse *fu,
-                                     long *tab, int fancy, struct bu_list 
*vlfree);
-RT_EXPORT extern void nmg_vlblock_s(struct bn_vlblock *vbp,
-                                    const struct shell *s,
-                                    int fancy,
-                                   struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_r(struct bn_vlblock *vbp,
-                                    const struct nmgregion *r,
-                                    int fancy,
-                                   struct bu_list *vlfree);
-RT_EXPORT extern void nmg_vlblock_m(struct bn_vlblock *vbp,
-                                    const struct model *m,
-                                    int fancy,
-                                   struct bu_list *vlfree);
-
-/* visualization helper routines */
-RT_EXPORT extern void nmg_pl_edges_in_2_shells(struct bn_vlblock        *vbp,
-                                               long                     *b,
-                                               const struct edgeuse     *eu,
-                                               int                      fancy,
-                                              struct bu_list *vlfree,
-                                               const struct bn_tol      *tol);
-RT_EXPORT extern void nmg_pl_isect(const char           *filename,
-                                   const struct shell   *s,
-                                  struct bu_list *vlfree,
-                                   const struct bn_tol  *tol);
-RT_EXPORT extern void nmg_pl_comb_fu(int num1,
-                                     int num2,
-                                     const struct faceuse *fu1,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_pl_2fu(const char *str,
-                                 const struct faceuse *fu1,
-                                 const struct faceuse *fu2,
-                                 int show_mates,
-                                struct bu_list *vlfree);
-/* graphical display of classifier results */
-RT_EXPORT extern void nmg_show_broken_classifier_stuff(uint32_t *p,
-                                                       char     **classlist,
-                                                       int      all_new,
-                                                       int      fancy,
-                                                       const char       
*a_string,
-                                                      struct bu_list *vlfree);
-RT_EXPORT extern void nmg_face_plot(const struct faceuse *fu, struct bu_list 
*vlfree);
-RT_EXPORT extern void nmg_2face_plot(const struct faceuse *fu1,
-                                     const struct faceuse *fu2,
-                                    struct bu_list *vlfree);
-RT_EXPORT extern void nmg_face_lu_plot(const struct loopuse *lu,
-                                       const struct vertexuse *vu1,
-                                       const struct vertexuse *vu2,
-                                      struct bu_list *vlfree);
-RT_EXPORT extern void nmg_plot_lu_ray(const struct loopuse              *lu,
-                                      const struct vertexuse            *vu1,
-                                      const struct vertexuse            *vu2,
-                                      const vect_t                      left,
-                                     struct bu_list *vlfree);

@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to