Revision: 69030
          http://sourceforge.net/p/brlcad/code/69030
Author:   starseeker
Date:     2016-10-11 23:57:55 +0000 (Tue, 11 Oct 2016)
Log Message:
-----------
RTG.NMG_debug -> nmg_debug

Modified Paths:
--------------
    brlcad/trunk/CHANGES
    brlcad/trunk/include/rt/global.h
    brlcad/trunk/include/rt/nmg.h
    brlcad/trunk/src/conv/dxf/g-dxf.c
    brlcad/trunk/src/conv/euclid/euclid-g.c
    brlcad/trunk/src/conv/euclid/g-euclid.c
    brlcad/trunk/src/conv/euclid/g-euclid1.c
    brlcad/trunk/src/conv/fast4-g.c
    brlcad/trunk/src/conv/g-acad.c
    brlcad/trunk/src/conv/g-egg.c
    brlcad/trunk/src/conv/g-nff.c
    brlcad/trunk/src/conv/g-obj.c
    brlcad/trunk/src/conv/g-shell-rect.c
    brlcad/trunk/src/conv/g-vrml.c
    brlcad/trunk/src/conv/g-x3d.c
    brlcad/trunk/src/conv/g-xxx.c
    brlcad/trunk/src/conv/g-xxx_facets.c
    brlcad/trunk/src/conv/iges/g-iges.c
    brlcad/trunk/src/conv/iges/main.c
    brlcad/trunk/src/conv/iges/trimsurf.c
    brlcad/trunk/src/conv/jack/g-jack.c
    brlcad/trunk/src/conv/nastran-g.c
    brlcad/trunk/src/conv/nmg/g-nmg.c
    brlcad/trunk/src/conv/nmg/nmg-sgp.c
    brlcad/trunk/src/conv/obj-g.c
    brlcad/trunk/src/conv/off/g-off.c
    brlcad/trunk/src/conv/patch/patch-g.c
    brlcad/trunk/src/conv/ply/g-ply.c
    brlcad/trunk/src/conv/raw/g-raw.c
    brlcad/trunk/src/conv/stl/g-stl.c
    brlcad/trunk/src/conv/tankill/g-tankill.c
    brlcad/trunk/src/conv/tankill/tankill-g.c
    brlcad/trunk/src/external/Cubit/g-sat.cpp
    brlcad/trunk/src/libgcv/gcv.c
    brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c
    brlcad/trunk/src/libgcv/plugins/obj/obj_read.c
    brlcad/trunk/src/libgcv/plugins/obj/obj_write.c
    brlcad/trunk/src/libgcv/plugins/vrml/vrml_write.c
    brlcad/trunk/src/libgcv/region_end.c
    brlcad/trunk/src/libgcv/region_end_mc.c
    brlcad/trunk/src/libged/debugnmg.c
    brlcad/trunk/src/librt/primitives/bspline/nurb_ray.c
    brlcad/trunk/src/librt/primitives/nmg/nmg.c
    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
    brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_extrude.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_fuse.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_index.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_info.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_junk.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_manif.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_mk.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_pt_fu.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_rt_segs.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_tri_mc.c
    brlcad/trunk/src/rt/opt.c
    brlcad/trunk/src/rt/rtshot.c
    brlcad/trunk/src/util/fix_polysolids.c

Modified: brlcad/trunk/CHANGES
===================================================================
--- brlcad/trunk/CHANGES        2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/CHANGES        2016-10-11 23:57:55 UTC (rev 69030)
@@ -1291,4 +1291,5 @@
 s/rt_nurb_solve/nmg_nurb_solve/g
 s/rt_nurb_to_poly/nmg_nurb_to_poly/g
         rename old nurbs functions intertwined with nmg to use nmg prefix 
[7.26]
-
+s/RTG.NMG_debug/nmg_debug/g
+       make nmg debug flag top level, like libbu's [7.26]

Modified: brlcad/trunk/include/rt/global.h
===================================================================
--- brlcad/trunk/include/rt/global.h    2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/include/rt/global.h    2016-10-11 23:57:55 UTC (rev 69030)
@@ -40,12 +40,13 @@
     /* DEPRECATED:  rtg_parallel is not used by LIBRT any longer (and will be 
removed) */
     int8_t              rtg_parallel;   /**< @brief  !0 = trying to use multi 
CPUs */
     struct bu_list      rtg_vlfree;     /**< @brief  head of bn_vlist freelist 
*/
-    uint32_t            NMG_debug;      /**< @brief  debug bits for NMG's see 
nmg.h */
     struct rt_wdb       rtg_headwdb;    /**< @brief  head of database object 
list */
 };
-#define RT_G_INIT_ZERO { 0, 0, BU_LIST_INIT_ZERO, 0, RT_WDB_INIT_ZERO }
+#define RT_G_INIT_ZERO { 0, 0, BU_LIST_INIT_ZERO, RT_WDB_INIT_ZERO }
 
 
+RT_EXPORT extern uint32_t nmg_debug;      /**< @brief  debug bits for NMG's 
see nmg.h */
+
 /**
  * global ray-trace geometry state
  */

Modified: brlcad/trunk/include/rt/nmg.h
===================================================================
--- brlcad/trunk/include/rt/nmg.h       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/include/rt/nmg.h       2016-10-11 23:57:55 UTC (rev 69030)
@@ -232,10 +232,10 @@
 #else
 #  define nmg_bu_bomb(rd, vlfree, str) { \
         bu_log("%s", str); \
-        if (RTG.NMG_debug & DEBUG_NMGRT) bu_bomb("End of diagnostics"); \
+        if (nmg_debug & DEBUG_NMGRT) bu_bomb("End of diagnostics"); \
         BU_LIST_INIT(&rd->rd_hit); \
         BU_LIST_INIT(&rd->rd_miss); \
-        RTG.NMG_debug |= DEBUG_NMGRT; \
+        nmg_debug |= DEBUG_NMGRT; \
         nmg_isect_ray_model(rd,vlfree); \
         (void) nmg_ray_segs(rd,vlfree); \
         bu_bomb("Should have bombed before this\n"); \

Modified: brlcad/trunk/src/conv/dxf/g-dxf.c
===================================================================
--- brlcad/trunk/src/conv/dxf/g-dxf.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/dxf/g-dxf.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -445,8 +445,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'i':
                inches = 1;

Modified: brlcad/trunk/src/conv/euclid/euclid-g.c
===================================================================
--- brlcad/trunk/src/conv/euclid/euclid-g.c     2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/euclid/euclid-g.c     2016-10-11 23:57:55 UTC (rev 
69030)
@@ -145,7 +145,7 @@
                sscanf(bu_optarg, "%x", (unsigned int *)&RTG.debug);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
                break;
            default:
                print_usage(argv[0]);

Modified: brlcad/trunk/src/conv/euclid/g-euclid.c
===================================================================
--- brlcad/trunk/src/conv/euclid/g-euclid.c     2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/euclid/g-euclid.c     2016-10-11 23:57:55 UTC (rev 
69030)
@@ -513,8 +513,8 @@
                sscanf(bu_optarg, "%x", (unsigned int *)&RTG.debug);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            default:
                usage(argv[0]);
@@ -632,7 +632,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/euclid/g-euclid1.c
===================================================================
--- brlcad/trunk/src/conv/euclid/g-euclid1.c    2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/euclid/g-euclid1.c    2016-10-11 23:57:55 UTC (rev 
69030)
@@ -409,7 +409,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -607,8 +607,8 @@
                sscanf(bu_optarg, "%x", (unsigned int *)&RTG.debug);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            default:
                print_usage(argv[0]);

Modified: brlcad/trunk/src/conv/fast4-g.c
===================================================================
--- brlcad/trunk/src/conv/fast4-g.c     2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/fast4-g.c     2016-10-11 23:57:55 UTC (rev 69030)
@@ -2856,8 +2856,8 @@
        bu_printb("librtbu_debug", bu_debug, DEBUG_FORMAT);
        bu_log("\n");
     }
-    if (RTG.NMG_debug) {
-       bu_printb("librt RTG.NMG_debug", RTG.NMG_debug, NMG_DEBUG_FORMAT);
+    if (nmg_debug) {
+       bu_printb("librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT);
        bu_log("\n");
     }
 

Modified: brlcad/trunk/src/conv/g-acad.c
===================================================================
--- brlcad/trunk/src/conv/g-acad.c      2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-acad.c      2016-10-11 23:57:55 UTC (rev 69030)
@@ -300,7 +300,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -424,7 +424,7 @@
                /* Sometimes the NMG library adds debugging bits when
                 * it detects an internal error, before bombing out.
                 */
-               RTG.NMG_debug = NMG_debug;      /* restore mode */
+               nmg_debug = NMG_debug;  /* restore mode */
 
                /* Release any intersector 2d tables */
                nmg_isect2d_final_cleanup();
@@ -539,8 +539,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'e':           /* Error file name. */
                error_file = bu_optarg;

Modified: brlcad/trunk/src/conv/g-egg.c
===================================================================
--- brlcad/trunk/src/conv/g-egg.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-egg.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -256,7 +256,7 @@
                rt_pr_tol(&conv_data.tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
                break;
            case '8':
                use_mc = 1;

Modified: brlcad/trunk/src/conv/g-nff.c
===================================================================
--- brlcad/trunk/src/conv/g-nff.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-nff.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -155,7 +155,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -195,7 +195,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -418,8 +418,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'e':           /* Error file name. */
                error_file = bu_optarg;

Modified: brlcad/trunk/src/conv/g-obj.c
===================================================================
--- brlcad/trunk/src/conv/g-obj.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-obj.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -141,8 +141,8 @@
 {
     BU_OPT_CHECK_ARGV0(error_msg, argc, argv, "debug nmg");
 
-    sscanf(argv[0], "%x", (unsigned int *)&RTG.NMG_debug);
-    NMG_debug = RTG.NMG_debug;
+    sscanf(argv[0], "%x", (unsigned int *)&nmg_debug);
+    NMG_debug = nmg_debug;
     return 1;
 }
 
@@ -525,7 +525,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -565,7 +565,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/g-shell-rect.c
===================================================================
--- brlcad/trunk/src/conv/g-shell-rect.c        2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/g-shell-rect.c        2016-10-11 23:57:55 UTC (rev 
69030)
@@ -1770,8 +1770,8 @@
                bot = 1;
                break;
            case 'X':   /* nmg debug flags */
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               bu_log("%s: setting RTG.NMG_debug to x%x\n", argv[0], 
RTG.NMG_debug);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               bu_log("%s: setting nmg_debug to x%x\n", argv[0], nmg_debug);
                break;
            default:
                print_usage(argv[0]);

Modified: brlcad/trunk/src/conv/g-vrml.c
===================================================================
--- brlcad/trunk/src/conv/g-vrml.c      2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-vrml.c      2016-10-11 23:57:55 UTC (rev 69030)
@@ -660,8 +660,8 @@
                sscanf(bu_optarg, "%x", (unsigned int *)&RTG.debug);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'u':
                units = bu_strdup(bu_optarg);
@@ -1296,7 +1296,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug; /* restore mode */
+       nmg_debug = NMG_debug; /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/g-x3d.c
===================================================================
--- brlcad/trunk/src/conv/g-x3d.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-x3d.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -431,8 +431,8 @@
                sscanf(bu_optarg, "%x", (unsigned int *)&RTG.debug);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'u':
                units = bu_strdup(bu_optarg);
@@ -977,7 +977,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/g-xxx.c
===================================================================
--- brlcad/trunk/src/conv/g-xxx.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/g-xxx.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -403,8 +403,8 @@
                bu_log("\n");
                break;
            case 'X':           /* NMG debug flag */
-               sscanf(bu_optarg, "%x", &RTG.NMG_debug);
-               bu_printb("librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT);
+               sscanf(bu_optarg, "%x", &nmg_debug);
+               bu_printb("librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT);
                bu_log("\n");
                break;
            default:

Modified: brlcad/trunk/src/conv/g-xxx_facets.c
===================================================================
--- brlcad/trunk/src/conv/g-xxx_facets.c        2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/g-xxx_facets.c        2016-10-11 23:57:55 UTC (rev 
69030)
@@ -146,8 +146,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            default:
                print_usage(argv[0]);
@@ -322,7 +322,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -362,7 +362,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/iges/g-iges.c
===================================================================
--- brlcad/trunk/src/conv/iges/g-iges.c 2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/iges/g-iges.c 2016-10-11 23:57:55 UTC (rev 69030)
@@ -264,8 +264,8 @@
                sscanf(bu_optarg, "%x", (unsigned int *)&RTG.debug);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'o':           /* Output file name. */
                output_file = bu_optarg;
@@ -467,7 +467,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release the tree memory & input regions */
        db_free_tree(curtree, &rt_uniresource);         /* Does an nmg_kr() */

Modified: brlcad/trunk/src/conv/iges/main.c
===================================================================
--- brlcad/trunk/src/conv/iges/main.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/iges/main.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -177,7 +177,7 @@
                    bu_debug |= BU_DEBUG_MEM_CHECK;
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
                break;
            default:
                usage(argv[0]);

Modified: brlcad/trunk/src/conv/iges/trimsurf.c
===================================================================
--- brlcad/trunk/src/conv/iges/trimsurf.c       2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/iges/trimsurf.c       2016-10-11 23:57:55 UTC (rev 
69030)
@@ -1110,14 +1110,14 @@
 
            next = hp->next;
 
-           if (RTG.NMG_debug & DEBUG_RT_ISECT)
+           if (nmg_debug & DEBUG_RT_ISECT)
                bu_log("\tintersect snurb surface at uv=(%g %g)\n", hp->u, 
hp->v);
 
            /* check if point is in face (trimming curves) */
            if (!uv_in_fu(hp->u, hp->v, fu)) {
                /* not a hit */
 
-               if (RTG.NMG_debug & DEBUG_RT_ISECT)
+               if (nmg_debug & DEBUG_RT_ISECT)
                    bu_log("\tNot a hit\n");
 
                bu_free((char *)hp, "nurb_uv_hit");

Modified: brlcad/trunk/src/conv/jack/g-jack.c
===================================================================
--- brlcad/trunk/src/conv/jack/g-jack.c 2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/jack/g-jack.c 2016-10-11 23:57:55 UTC (rev 69030)
@@ -250,7 +250,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -495,8 +495,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            default:
                print_usage(argv[0]);

Modified: brlcad/trunk/src/conv/nastran-g.c
===================================================================
--- brlcad/trunk/src/conv/nastran-g.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/nastran-g.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -1137,8 +1137,8 @@
                bu_log("\n");
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               bu_printb("librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               bu_printb("librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT);
                bu_log("\n");
                break;
            case 't':           /* calculational tolerance */

Modified: brlcad/trunk/src/conv/nmg/g-nmg.c
===================================================================
--- brlcad/trunk/src/conv/nmg/g-nmg.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/nmg/g-nmg.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -96,7 +96,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -483,9 +483,9 @@
                bu_log("\n");
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
-               bu_printb("librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
+               bu_printb("librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT);
                bu_log("\n");
                break;
            default:

Modified: brlcad/trunk/src/conv/nmg/nmg-sgp.c
===================================================================
--- brlcad/trunk/src/conv/nmg/nmg-sgp.c 2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/nmg/nmg-sgp.c 2016-10-11 23:57:55 UTC (rev 69030)
@@ -161,8 +161,8 @@
                bu_log("\n");
                break;
            case 'X':
-               sscanf( bu_optarg, "%x", &RTG.NMG_debug );
-               bu_printb( "librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT );
+               sscanf( bu_optarg, "%x", &nmg_debug );
+               bu_printb( "librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT );
                bu_log("\n");
                break;
            default:

Modified: brlcad/trunk/src/conv/obj-g.c
===================================================================
--- brlcad/trunk/src/conv/obj-g.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/obj-g.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -2755,7 +2755,7 @@
        /* Sometimes the NMG library adds debugging bits when it
         * detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug; /* restore mode */
+       nmg_debug = NMG_debug; /* restore mode */
 
        if (verts)
            bu_free(verts, "verts");
@@ -3252,9 +3252,9 @@
                bu_log("\n");
                break;
            case 'X': /* set nmg debug level */
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
-               bu_printb("librt RTG.NMG_debug", RTG.NMG_debug,
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
+               bu_printb("librt nmg_debug", nmg_debug,
                          NMG_DEBUG_FORMAT);
                bu_log("\n");
                break;

Modified: brlcad/trunk/src/conv/off/g-off.c
===================================================================
--- brlcad/trunk/src/conv/off/g-off.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/off/g-off.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -132,8 +132,8 @@
                sscanf( bu_optarg, "%x", (unsigned int *)&RTG.debug );
                break;
            case 'X':
-               sscanf( bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug );
-               NMG_debug = RTG.NMG_debug;
+               sscanf( bu_optarg, "%x", (unsigned int *)&nmg_debug );
+               NMG_debug = nmg_debug;
                break;
            default:
                print_usage(argv[0]);
@@ -224,7 +224,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/patch/patch-g.c
===================================================================
--- brlcad/trunk/src/conv/patch/patch-g.c       2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/patch/patch-g.c       2016-10-11 23:57:55 UTC (rev 
69030)
@@ -395,7 +395,7 @@
     bu_free((char *)flags1, "nmg_shell_coplanar_face_merge flags1[]");
     bu_free((char *)flags2, "nmg_shell_coplanar_face_merge flags2[]");
 
-    if (RTG.NMG_debug & DEBUG_BASIC) {
+    if (nmg_debug & DEBUG_BASIC) {
        bu_log("nmg_shell_coplanar_face_merge(s=%p, tol=%p, simplify=%d)\n",
               (void *)s, (void *)tol, simplify);
     }
@@ -3455,7 +3455,7 @@
 
            case 'X':  /* librt NMG debug flags */
 
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
                break;
 
            case 'p':  /* polysolid output */
@@ -3545,8 +3545,8 @@
        bu_log("\n");
     }
 
-    if (RTG.NMG_debug) {
-       bu_log("librt RTG.NMG_debug = 0x%x\n", RTG.NMG_debug);
+    if (nmg_debug) {
+       bu_log("librt nmg_debug = 0x%x\n", nmg_debug);
     }
 
     /* This section opens input files - the data file defaults to

Modified: brlcad/trunk/src/conv/ply/g-ply.c
===================================================================
--- brlcad/trunk/src/conv/ply/g-ply.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/ply/g-ply.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -387,7 +387,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -427,7 +427,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -658,8 +658,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            default:
                bu_exit(1, usage, argv[0]);

Modified: brlcad/trunk/src/conv/raw/g-raw.c
===================================================================
--- brlcad/trunk/src/conv/raw/g-raw.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/raw/g-raw.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -282,8 +282,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'i':
                inches = 1;

Modified: brlcad/trunk/src/conv/stl/g-stl.c
===================================================================
--- brlcad/trunk/src/conv/stl/g-stl.c   2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/conv/stl/g-stl.c   2016-10-11 23:57:55 UTC (rev 69030)
@@ -378,8 +378,8 @@
                rt_pr_tol(&tol);
                break;
            case 'X':
-               sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
-               NMG_debug = RTG.NMG_debug;
+               sscanf(bu_optarg, "%x", (unsigned int *)&nmg_debug);
+               NMG_debug = nmg_debug;
                break;
            case 'i':
                inches = 1;

Modified: brlcad/trunk/src/conv/tankill/g-tankill.c
===================================================================
--- brlcad/trunk/src/conv/tankill/g-tankill.c   2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/tankill/g-tankill.c   2016-10-11 23:57:55 UTC (rev 
69030)
@@ -470,8 +470,8 @@
                sscanf( bu_optarg, "%x", (unsigned int *)&RTG.debug );
                break;
            case 'X':
-               sscanf( bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug );
-               NMG_debug = RTG.NMG_debug;
+               sscanf( bu_optarg, "%x", (unsigned int *)&nmg_debug );
+               NMG_debug = nmg_debug;
                break;
            default:
                printusage(argv[0]);
@@ -595,7 +595,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;      /* restore mode */
+       nmg_debug = NMG_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -635,7 +635,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = NMG_debug;/* restore mode */
+       nmg_debug = NMG_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();

Modified: brlcad/trunk/src/conv/tankill/tankill-g.c
===================================================================
--- brlcad/trunk/src/conv/tankill/tankill-g.c   2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/conv/tankill/tankill-g.c   2016-10-11 23:57:55 UTC (rev 
69030)
@@ -188,8 +188,8 @@
                bu_log("\n");
                break;
            case 'X':
-               sscanf( bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug );
-               bu_printb( "librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT );
+               sscanf( bu_optarg, "%x", (unsigned int *)&nmg_debug );
+               bu_printb( "librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT );
                bu_log("\n");
                break;
            case 'k': /* keep component codes of 1001 */

Modified: brlcad/trunk/src/external/Cubit/g-sat.cpp
===================================================================
--- brlcad/trunk/src/external/Cubit/g-sat.cpp   2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/external/Cubit/g-sat.cpp   2016-10-11 23:57:55 UTC (rev 
69030)
@@ -197,8 +197,8 @@
                bu_log("\n");
                break;
            case 'X':               /* NMG debug flag */
-               sscanf(bu_optarg, "%x", &RTG.NMG_debug);
-               bu_printb("librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT);
+               sscanf(bu_optarg, "%x", &nmg_debug);
+               bu_printb("librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT);
                bu_log("\n");
                break;
            default:

Modified: brlcad/trunk/src/libgcv/gcv.c
===================================================================
--- brlcad/trunk/src/libgcv/gcv.c       2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/libgcv/gcv.c       2016-10-11 23:57:55 UTC (rev 69030)
@@ -421,7 +421,7 @@
 {
     const int bu_debug_orig = bu_debug;
     const uint32_t rt_debug_orig = RTG.debug;
-    const uint32_t nmg_debug_orig = RTG.NMG_debug;
+    const uint32_t nmg_debug_orig = nmg_debug;
     int dbi_read_only_orig;
 
     int result;
@@ -463,7 +463,7 @@
 
     bu_debug |= gcv_options->bu_debug_flag;
     RTG.debug |= gcv_options->rt_debug_flag;
-    RTG.NMG_debug |= gcv_options->nmg_debug_flag;
+    nmg_debug |= gcv_options->nmg_debug_flag;
 
     dbi_read_only_orig = context->dbip->dbi_read_only;
 
@@ -493,7 +493,7 @@
 
     bu_debug = bu_debug_orig;
     RTG.debug = rt_debug_orig;
-    RTG.NMG_debug = nmg_debug_orig;
+    nmg_debug = nmg_debug_orig;
     context->dbip->dbi_read_only = dbi_read_only_orig;
 
     _gcv_filter_options_free(filter, options_data);

Modified: brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c    2016-10-11 
23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c    2016-10-11 
23:57:55 UTC (rev 69030)
@@ -2980,8 +2980,8 @@
        bu_printb("librtbu_debug", bu_debug, DEBUG_FORMAT);
        bu_log("\n");
     }
-    if (RTG.NMG_debug) {
-       bu_printb("librt RTG.NMG_debug", RTG.NMG_debug, NMG_DEBUG_FORMAT);
+    if (nmg_debug) {
+       bu_printb("librt nmg_debug", nmg_debug, NMG_DEBUG_FORMAT);
        bu_log("\n");
     }
 

Modified: brlcad/trunk/src/libgcv/plugins/obj/obj_read.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/obj/obj_read.c      2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/libgcv/plugins/obj/obj_read.c      2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -2676,7 +2676,7 @@
        /* Sometimes the NMG library adds debugging bits when it
         * detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = ga->nmg_debug; /* restore mode */
+       nmg_debug = ga->nmg_debug; /* restore mode */
 
        if (verts)
            bu_free(verts, "verts");
@@ -3479,7 +3479,7 @@
     memset(&ga, 0, sizeof(ga));
 
     ga.gcv_options = gcv_options;
-    ga.nmg_debug = RTG.NMG_debug;
+    ga.nmg_debug = nmg_debug;
 
     if (obj_parser_create(&ga.parser)) {
        bu_log("Cannot initialize an obj_parser_t object\n");

Modified: brlcad/trunk/src/libgcv/plugins/obj/obj_write.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/obj/obj_write.c     2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/libgcv/plugins/obj/obj_write.c     2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -305,7 +305,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before bombing out.
         */
-       RTG.NMG_debug = pstate->nmg_debug;      /* restore mode */
+       nmg_debug = pstate->nmg_debug;  /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -345,7 +345,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = pstate->nmg_debug;/* restore mode */
+       nmg_debug = pstate->nmg_debug;/* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -513,7 +513,7 @@
     memset(&state, 0, sizeof(state));
     state.gcv_options = gcv_options;
     state.obj_write_options = (struct obj_write_options *)options_data;
-    state.nmg_debug = RTG.NMG_debug;
+    state.nmg_debug = nmg_debug;
 
     if (!(state.fp = fopen(dest_path, "wb+"))) {
        perror("libgcv");

Modified: brlcad/trunk/src/libgcv/plugins/vrml/vrml_write.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/vrml/vrml_write.c   2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/libgcv/plugins/vrml/vrml_write.c   2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -1067,7 +1067,7 @@
        /* Sometimes the NMG library adds debugging bits when
         * it detects an internal error, before before bombing out.
         */
-       RTG.NMG_debug = pstate->nmg_debug; /* restore mode */
+       nmg_debug = pstate->nmg_debug; /* restore mode */
 
        /* Release any intersector 2d tables */
        nmg_isect2d_final_cleanup();
@@ -1227,7 +1227,7 @@
     state.gcv_options = gcv_options;
     state.vrml_write_options = (struct vrml_write_options *)options_data;
     state.dbip = context->dbip;
-    state.nmg_debug = RTG.NMG_debug;
+    state.nmg_debug = nmg_debug;
 
     region_end_data.pstate = &state;
     region_end_data.pmp = &pm;

Modified: brlcad/trunk/src/libgcv/region_end.c
===================================================================
--- brlcad/trunk/src/libgcv/region_end.c        2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/libgcv/region_end.c        2016-10-11 23:57:55 UTC (rev 
69030)
@@ -33,7 +33,7 @@
 _gcv_cleanup(int state, union tree *tp)
 {
     /* restore previous debug state */
-    RTG.NMG_debug = state;
+    nmg_debug = state;
 
     /* Dispose of original tree, so that all associated dynamic memory
      * is released now, not at the end of all regions.  A return of
@@ -100,7 +100,7 @@
     /* Sometimes the NMG library adds debugging bits when it detects
      * an internal error, before bombing.  Stash.
      */
-    NMG_debug_state = RTG.NMG_debug;
+    NMG_debug_state = nmg_debug;
 
     if (!BU_SETJUMP) {
        /* try */

Modified: brlcad/trunk/src/libgcv/region_end_mc.c
===================================================================
--- brlcad/trunk/src/libgcv/region_end_mc.c     2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/libgcv/region_end_mc.c     2016-10-11 23:57:55 UTC (rev 
69030)
@@ -88,7 +88,7 @@
     /* Sometimes the NMG library adds debugging bits when it detects
      * an internal error, before bombing.  Stash.
      */
-    NMG_debug_state = RTG.NMG_debug;
+    NMG_debug_state = nmg_debug;
 
     m = nmg_mmr();
     r = nmg_mrsv(m);

Modified: brlcad/trunk/src/libged/debugnmg.c
===================================================================
--- brlcad/trunk/src/libged/debugnmg.c  2016-10-11 23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/libged/debugnmg.c  2016-10-11 23:57:55 UTC (rev 69030)
@@ -54,13 +54,13 @@
        bu_vls_printf(gedp->ged_result_str, "\n");
     } else {
        /* set librt's NMG debug bit vector */
-       if (sscanf(argv[1], "%x", (unsigned int *)&RTG.NMG_debug) != 1) {
+       if (sscanf(argv[1], "%x", (unsigned int *)&nmg_debug) != 1) {
            bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
            return GED_ERROR;
        }
     }
 
-    bu_vls_printb(gedp->ged_result_str, "librt RTG.NMG_debug", RTG.NMG_debug, 
NMG_DEBUG_FORMAT);
+    bu_vls_printb(gedp->ged_result_str, "librt nmg_debug", nmg_debug, 
NMG_DEBUG_FORMAT);
     bu_vls_printf(gedp->ged_result_str, "\n");
 
     return GED_OK;

Modified: brlcad/trunk/src/librt/primitives/bspline/nurb_ray.c
===================================================================
--- brlcad/trunk/src/librt/primitives/bspline/nurb_ray.c        2016-10-11 
23:30:56 UTC (rev 69029)
+++ brlcad/trunk/src/librt/primitives/bspline/nurb_ray.c        2016-10-11 
23:57:55 UTC (rev 69030)
@@ -48,7 +48,7 @@
     int rational;
     int i;
 
-    if (RTG.NMG_debug & DEBUG_RT_ISECT)
+    if (nmg_debug & DEBUG_RT_ISECT)
        bu_log("nmg_nurb_project_srf: projecting surface, planes = (%g %g %g 
%g) (%g %g %g %g)\n",
               V4ARGS(plane1), V4ARGS(plane2));
 
@@ -91,7 +91,7 @@
                mp1[2] * plane2[2] - plane2[3];
        }
 
-       if (RTG.NMG_debug & DEBUG_RT_ISECT) {
+       if (nmg_debug & DEBUG_RT_ISECT) {
            if (rational)
                bu_log("\tmesh pt (%g %g %g %g), becomes (%g %g)\n", 
V4ARGS(mp1), mp2[0], mp2[1]);
            else

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg.c 2016-10-11 23:30:56 UTC (rev 
69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg.c 2016-10-11 23:57:55 UTC (rev 
69030)
@@ -154,7 +154,7 @@
     struct nmg_specific *nmg =
        (struct nmg_specific *)stp->st_specific;
 
-    if (RTG.NMG_debug & DEBUG_NMGRT) {
+    if (nmg_debug & DEBUG_NMGRT) {
        bu_log("rt_nmg_shot()\n\t");
        rt_pr_tol(&ap->a_rt_i->rti_tol);
     }
@@ -2430,7 +2430,7 @@
     m = (struct model *)ip->idb_ptr;
     NMG_CK_MODEL(m);
 
-    if (RT_G_DEBUG || RTG.NMG_debug)
+    if (RT_G_DEBUG || nmg_debug)
        nmg_vmodel(m);
 
     return 0;                  /* OK */
@@ -2524,7 +2524,7 @@
     bu_free((char *)ecnt, "ecnt[]");
     bu_free((char *)real_ptrs, "ptrs[]");
 
-    if (RT_G_DEBUG || RTG.NMG_debug) {
+    if (RT_G_DEBUG || nmg_debug) {
        nmg_vmodel(m);
     }
     return 0;          /* OK */
@@ -3353,7 +3353,7 @@
     }
 
     NMG_CK_REGION(r1);
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        nmg_vshell(&r1->s_hd, r1);
     }
 
@@ -3409,7 +3409,7 @@
     }
 
     NMG_CK_REGION(r1);
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        nmg_vshell(&r1->s_hd, r1);
     }
 
@@ -3471,7 +3471,7 @@
            return TREE_NULL;
        case OP_NMG_TESS:
            /* Hit a tree leaf */
-           if (RTG.NMG_debug & DEBUG_VERIFY) {
+           if (nmg_debug & DEBUG_VERIFY) {
                nmg_vshell(&tp->tr_d.td_r->s_hd, tp->tr_d.td_r);
            }
            return tp;
@@ -3604,7 +3604,7 @@
     nmg_r_radial_check(tr->tr_d.td_r, vlfree, tol);
     nmg_r_radial_check(tl->tr_d.td_r, vlfree, tol);
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        bu_log("Before model fuse\nShell A:\n");
        nmg_pr_s_briefly(BU_LIST_FIRST(shell, &tl->tr_d.td_r->s_hd), "");
        bu_log("Shell B:\n");
@@ -3639,7 +3639,7 @@
        tp->tr_d.td_r = reg;
        tp->tr_d.td_name = name;
 
-       if (RTG.NMG_debug & DEBUG_VERIFY) {
+       if (nmg_debug & DEBUG_VERIFY) {
            nmg_vshell(&reg->s_hd, reg);
        }
        return tp;
@@ -3678,7 +3678,7 @@
     BN_CK_TOL(tol);
     RT_CK_RESOURCE(resp);
 
-    if (RTG.NMG_debug & (DEBUG_BOOL|DEBUG_BASIC)) {
+    if (nmg_debug & (DEBUG_BOOL|DEBUG_BASIC)) {
        bu_log("\n\nnmg_boolean(tp=%p, m=%p) START\n",
               (void *)tp, (void *)m);
     }
@@ -3731,7 +3731,7 @@
     ret = 0;
 
 out:
-    if (RTG.NMG_debug & (DEBUG_BOOL|DEBUG_BASIC)) {
+    if (nmg_debug & (DEBUG_BOOL|DEBUG_BASIC)) {
        bu_log("nmg_boolean(tp=%p, m=%p) END, ret=%d\n\n",
               (void *)tp, (void *)m, ret);
     }
@@ -4484,7 +4484,7 @@
 
                /* if any loop has more than 5 vertices, triangulate the face */
                if (max_count > 5) {
-                   if (RTG.NMG_debug & DEBUG_BASIC)
+                   if (nmg_debug & DEBUG_BASIC)
                        bu_log("nmg_to_poly: triangulating fu %p\n", (void 
*)fu);
                    nmg_triangulate_fu(fu, vlfree, tol);
                }

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -218,7 +218,7 @@
     long save;
 
     NMG_CK_SHELL(s);
-    save = RTG.NMG_debug;
+    save = nmg_debug;
     for (BU_LIST_FOR(fu, faceuse, &s->fu_hd)) {
        NMG_CK_FACEUSE(fu);
        if (fu->orientation == OT_OPPOSITE) continue;
@@ -237,7 +237,7 @@
        snprintf(buf, 128, "%s=%p (wire)", str, (void *)lu);
        nmg_show_broken_classifier_stuff(&lu->l.magic, classlist, redraw, 
fancy, buf, vlfree);
     }
-    RTG.NMG_debug = save;              /* restore it */
+    nmg_debug = save;          /* restore it */
 }
 
 
@@ -274,7 +274,7 @@
     struct faceuse *fu;
     struct faceuse *fu_next;
 
-    if (RTG.NMG_debug & DEBUG_BASIC)
+    if (nmg_debug & DEBUG_BASIC)
        bu_log("nmg_kill_non_common_cracks(s=%p and %p)\n", (void *)sA, (void 
*)sB);
 
     NMG_CK_SHELL(sA);
@@ -434,7 +434,7 @@
     struct bu_ptbl edges;
     size_t i;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("nmg_classify_shared_edges_verts(sA=%p, sB=%p)\n", (void *)sA, 
(void *)sB);
 
     NMG_CK_SHELL(sA);
@@ -456,7 +456,7 @@
                NMG_INDEX_SET(classlist[NMG_CLASS_AonBshared], v);
                NMG_INDEX_SET(classlist[4 + NMG_CLASS_AonBshared], v);
 
-               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+               if (nmg_debug & DEBUG_CLASSIFY)
                    bu_log("nmg_classify_shared_edges_verts: v=%p is shared\n", 
(void *)v);
 
                break;
@@ -483,7 +483,7 @@
                NMG_INDEX_SET(classlist[NMG_CLASS_AonBshared], e);
                NMG_INDEX_SET(classlist[4 + NMG_CLASS_AonBshared], e);
 
-               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+               if (nmg_debug & DEBUG_CLASSIFY)
                    bu_log("nmg_classify_shared_edges_verts: e=%p is shared\n", 
(void *)e);
 
                break;
@@ -712,7 +712,7 @@
     }
 
     debug_file_count++;
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        /* Sometimes the tessellations of non-participating regions
         * are damaged during a boolean operation.  Check everything.
         */
@@ -725,36 +725,36 @@
     nmg_model_fuse(m, vlfree, tol);
 
     if (nmg_check_closed_shell(sA, tol)) {
-       if (RTG.NMG_debug & DEBUG_BOOL &&
-           RTG.NMG_debug & DEBUG_PLOTEM) {
+       if (nmg_debug & DEBUG_BOOL &&
+           nmg_debug & DEBUG_PLOTEM) {
            if ((fp=fopen("Unclosed.plot3", "wb")) != (FILE *)NULL) {
                bu_log("Plotting unclosed NMG shell\n");
                nmg_pl_s(fp, sA, vlfree);
                fclose(fp);
            }
        }
-       if (RTG.NMG_debug & DEBUG_BOOL)
+       if (nmg_debug & DEBUG_BOOL)
            nmg_pr_s(sA, "");
 
        bu_log("nmg_bool: sA is unclosed, barging ahead\n");
     }
 
     if (nmg_check_closed_shell(sB, tol)) {
-       if (RTG.NMG_debug & DEBUG_BOOL &&
-           RTG.NMG_debug & DEBUG_PLOTEM) {
+       if (nmg_debug & DEBUG_BOOL &&
+           nmg_debug & DEBUG_PLOTEM) {
            if ((fp=fopen("Unclosed.plot3", "wb")) != (FILE *)NULL) {
                bu_log("Plotting unclosed NMG shell\n");
                nmg_pl_s(fp, sB, vlfree);
                fclose(fp);
            }
        }
-       if (RTG.NMG_debug & DEBUG_BOOL)
+       if (nmg_debug & DEBUG_BOOL)
            nmg_pr_s(sB, "");
        bu_log("nmg_bool: sB is unclosed, barging ahead\n");
     }
 
 
-    if (RTG.NMG_debug & DEBUG_BOOL && RTG.NMG_debug & DEBUG_PLOTEM) {
+    if (nmg_debug & DEBUG_BOOL && nmg_debug & DEBUG_PLOTEM) {
        if ((fp=fopen("shellA.plot3", "wb")) == (FILE*)NULL) {
            (void)perror("shellA.plot3");
            bu_bomb("unable to open shellA.plot3 for writing");
@@ -772,14 +772,14 @@
        fclose(fp);
     }
 
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        /* Sometimes the tessellations of non-participating regions
         * are damaged during a boolean operation.  Check everything.
         */
        nmg_vmodel(m);
     }
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        char file_name[256];
 
        sprintf(file_name, "before%d.g", debug_file_count);
@@ -789,7 +789,7 @@
     /* Perform shell/shell intersections */
     nmg_crackshells(sA, sB, vlfree, tol);
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        stash_shell(sA, "a1_", "sA", tol);
        stash_shell(sB, "b1_", "sB", tol);
        bu_log("Just After Crackshells:\nShell A:\n");
@@ -828,7 +828,7 @@
 
     (void)nmg_edge_fuse(&m->magic, vlfree, tol);
 
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        /* Sometimes the tessellations of non-participating regions
         * are damaged during a boolean operation.  Check everything.
         */
@@ -839,7 +839,7 @@
        }
     }
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        int dangle_error = 0;
        if (nmg_has_dangling_faces((uint32_t *)rA, (char *)NULL, vlfree)) {
            dangle_error = 1;
@@ -859,7 +859,7 @@
        }
     }
 
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        /* Sometimes the tessellations of non-participating regions
         * are damaged during a boolean operation.  Check everything.
         */
@@ -871,7 +871,7 @@
      * ones, so that maximal splits will be possible.
      * This is essential for cutting holes in faces, e.g. Test3.r
      */
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        char file_name[256];
 
        sprintf(file_name, "notjoined%d.g", debug_file_count);
@@ -882,7 +882,7 @@
     nmg_shell_a(sA, tol);
     nmg_shell_a(sB, tol);
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        stash_shell(sA, "a", "sA", tol);
        stash_shell(sB, "b", "sB", tol);
 
@@ -892,15 +892,15 @@
        nmg_pr_s_briefly(sB, 0);
     }
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        char file_name[256];
 
        sprintf(file_name, "after%d.g", debug_file_count);
        nmg_stash_model_to_file(file_name, m, "After crackshells");
     }
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
-       if (RTG.NMG_debug & DEBUG_PLOTEM) {
+    if (nmg_debug & DEBUG_BOOL) {
+       if (nmg_debug & DEBUG_PLOTEM) {
            if ((fd = fopen("Cracked_Shells.plot3", "wb")) == (FILE *)NULL) {
                (void)perror("Cracked_Shells");
                bu_bomb("unable to open Cracked_Shells.plot3 for writing");
@@ -923,7 +923,7 @@
     if (nmg_ck_closed_surf(sB, tol))
        bu_log("nmg_bool() WARNING: sB unclosed before classification.  Boldly 
pressing on.\n");
 
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        /* Sometimes the tessellations of non-participating regions
         * are damaged during a boolean operation.  Check everything.
         */
@@ -944,7 +944,7 @@
     nmg_classify_shared_edges_verts(sA, sB, classlist, vlfree);
 
     nmg_class_nothing_broken = 1;
-    if (RTG.NMG_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
+    if (nmg_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
        nmg_show_broken_classifier_stuff((uint32_t *)sA, &classlist[0], 
nmg_class_nothing_broken, 1, "unclassed sA", vlfree);
        nmg_show_broken_classifier_stuff((uint32_t *)sB, &classlist[4], 1, 1, 
"unclassed sB", vlfree);
     }
@@ -978,7 +978,7 @@
        m->manifolds = (char *)NULL;
     }
 
-    if (RTG.NMG_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
+    if (nmg_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
        nmg_class_nothing_broken = 1;
 
        /* Show each loop, one at a time, non-fancy */
@@ -991,7 +991,7 @@
        nmg_show_broken_classifier_stuff((uint32_t *)sB, &classlist[4], 1, 0, 
"sB classed", vlfree);
     }
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        bu_log("Just before nmg_evaluate_boolean:\nShell A:\n");
        nmg_pr_s_briefly(sA, 0);
        bu_log("Shell B:\n");
@@ -1003,13 +1003,13 @@
     nmg_evaluate_boolean(sA, sB, oper, classlist, vlfree, tol);
     sB = NULL; /* sanity, killed during boolean eval */
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        bu_log("Just after nmg_evaluate_boolean:\nShell A:\n");
        nmg_pr_s_briefly(sA, 0);
        bu_log("Shell B:\nFreed.");
     }
 
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        nmg_vmodel(m);
        if ((i = nmg_model_fuse(m, vlfree, tol)) > 0) {
            bu_log("ERROR: nmg_bool: fused %d entities after BOOLEAN.  Isect 
bug.\n", i);
@@ -1027,7 +1027,7 @@
 
        nmg_s_radial_check(sA, vlfree, tol);
 
-       if (RTG.NMG_debug & DEBUG_BOOL) {
+       if (nmg_debug & DEBUG_BOOL) {
            int dangle_error = 0;
            if (nmg_has_dangling_faces((uint32_t *)rA, (char *)NULL, vlfree)) {
                dangle_error = 1;
@@ -1053,7 +1053,7 @@
        }
 
        /* Do this before table size changes */
-       if (RTG.NMG_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
+       if (nmg_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
            nmg_class_nothing_broken = 1;
 
            /* Show final result of the boolean */
@@ -1064,12 +1064,12 @@
         * possible to reduce the loop/edge count.
         */
        nmg_simplify_shell(sA, vlfree);
-       if (RTG.NMG_debug & DEBUG_VERIFY)
+       if (nmg_debug & DEBUG_VERIFY)
            nmg_vshell(&rA->s_hd, rA);
 
        (void) nmg_unbreak_region_edges(&sA->l.magic, vlfree);
 
-       if (RTG.NMG_debug & DEBUG_BOOL) {
+       if (nmg_debug & DEBUG_BOOL) {
            bu_log("Just after nmg_simplify_shell:\nShell A:\n");
            nmg_pr_s_briefly(sA, 0);
        }
@@ -1078,14 +1078,14 @@
        nmg_shell_a(sA, tol);
 
        if (nmg_ck_closed_surf(sA, tol)) {
-           if (RTG.NMG_debug)
+           if (nmg_debug)
                bu_log("nmg_bool() WARNING: sA unclosed at return, barging 
on.\n");
            else
                bu_bomb("nmg_bool() sA unclosed at return, aborting.\n");
        }
        nmg_s_radial_check(sA, vlfree, tol);
 
-       if (RTG.NMG_debug & DEBUG_BOOL) {
+       if (nmg_debug & DEBUG_BOOL) {
            char tmp_name[256];
            sprintf(tmp_name, "after_bool_%d.g", debug_file_count);
            nmg_stash_model_to_file(tmp_name, m, "After Boolean");
@@ -1096,10 +1096,10 @@
        bu_free((char *)classlist[i], "nmg_bool classlist");
     }
 
-    if (RTG.NMG_debug & DEBUG_BOOL) {
+    if (nmg_debug & DEBUG_BOOL) {
        bu_log("Returning from NMG_BOOL\n");
     }
-    if (RTG.NMG_debug & DEBUG_VERIFY) {
+    if (nmg_debug & DEBUG_VERIFY) {
        /* Sometimes the tessellations of non-participating regions
         * are damaged during a boolean operation.  Check everything.
         */

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c      2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c      2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -1237,7 +1237,7 @@
 #ifndef NEW_DANGLING_FACE_CHECKING_METHOD
     return 0;
 #else
-    if (RTG.NMG_debug & DEBUG_BASIC) {
+    if (nmg_debug & DEBUG_BASIC) {
        bu_log("nmg_check_radial(eu=x%x, tol)\n", eu);
     }
 
@@ -1298,7 +1298,7 @@
                   nmg_orientation(curr_orient));
 
            /* Plot the edge in yellow, & the loops */
-           RTG.NMG_debug |= DEBUG_PLOTEM;
+           nmg_debug |= DEBUG_PLOTEM;
            nmg_face_lu_plot(eu1->up.lu_p, eu1->vu_p,
                             eu1->eumate_p->vu_p);
            nmg_face_lu_plot(eur->up.lu_p, eur->vu_p,
@@ -1438,7 +1438,7 @@
     } while (eur != eurstart);
     /* All is well, the whole way 'round */
 out:
-    if (RTG.NMG_debug & DEBUG_BASIC) {
+    if (nmg_debug & DEBUG_BASIC) {
        bu_log("nmg_eu_2s_orient_bad(eu=%p, s1=%p, s2=%p) ret=%d\n",
               (void *)eu_orig, (void *)s1, (void *)s2, ret);
     }

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_class.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_class.c   2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_class.c   2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -133,7 +133,7 @@
 
     eu_rinf = nmg_faceradial(eu);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("joint_hitmiss2\n");
     }
     if (eu_rinf == eu) {
@@ -167,7 +167,7 @@
                closest->p.vu = BU_LIST_PNEXT_CIRC(edgeuse, eu)->vu_p;
                break;
        }
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) bu_log("\t\t%s\n", 
nmg_class_name(closest->nmg_class));
+       if (nmg_debug & DEBUG_CLASSIFY) bu_log("\t\t%s\n", 
nmg_class_name(closest->nmg_class));
        return;
     }
 
@@ -175,7 +175,7 @@
     bu_bomb("nmg_class.c/joint_hitmiss2() unable to resolve ray/edge hit\n");
     bu_log("joint_hitmiss2: NO CODE HERE, assuming miss\n");
 
-    if (RTG.NMG_debug & (DEBUG_CLASSIFY|DEBUG_NMGRT)) {
+    if (nmg_debug & (DEBUG_CLASSIFY|DEBUG_NMGRT)) {
        nmg_euprint("Hard question time", eu);
        bu_log(" eu_rinf=%p, eu->eumate_p=%p, eu=%p\n", (void *)eu_rinf, (void 
*)eu->eumate_p, (void *)eu);
        bu_log(" eu lu orient=%s, eu_rinf lu orient=%s\n",
@@ -224,7 +224,7 @@
     eupt = eu->vu_p->v_p->vg_p->coord;
     matept = eu->eumate_p->vu_p->v_p->vg_p->coord;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        VPRINT("nmg_class_pt_e\tPt", pt);
        nmg_euprint("          \tvs. eu", eu);
     }
@@ -239,13 +239,13 @@
                             eu->eumate_p->vu_p->v_p->vg_p->coord,
                             pt, tol);
     if (code <= 0) dist = 0;
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("          \tcode=%d, dist: %g\n", code, dist);
        VPRINT("          \tpca:", pca);
     }
 
     if (dist >= closest->dist + tol->dist) {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("\t\tskipping, earlier eu is closer (%g)\n", closest->dist);
        }
        return;
@@ -262,11 +262,11 @@
            if (closest->nmg_class == NMG_CLASS_AoutB ||
                closest->nmg_class == NMG_CLASS_AonBshared ||
                closest->nmg_class == NMG_CLASS_AonBanti) {
-               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+               if (nmg_debug & DEBUG_CLASSIFY)
                    bu_log("\t\tSkipping, earlier eu from same lu at same dist, 
is OUT or ON.\n");
                return;
            }
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("\t\tEarlier eu from same lu at same dist, is IN, 
continue processing.\n");
        } else {
            /*
@@ -284,17 +284,17 @@
            if (closest->nmg_class == NMG_CLASS_AinB ||
                closest->nmg_class == NMG_CLASS_AonBshared ||
                closest->nmg_class == NMG_CLASS_AonBanti) {
-               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+               if (nmg_debug & DEBUG_CLASSIFY)
                    bu_log("\t\tSkipping, earlier eu from other another lu at 
same dist, is IN or ON\n");
                return;
            }
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("\t\tEarlier eu from other lu at same dist, is OUT, 
continue processing.\n");
        }
     }
 
     /* Plane hit point is closer to this edgeuse than previous one(s) */
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("\t\tCLOSER dist=%g (closest=%g), tol=%g\n",
               dist, closest->dist, tol->dist);
     }
@@ -312,13 +312,13 @@
     if (code <= 2) {
        /* code==0:  The point is ON the edge! */
        /* code==1 or 2:  The point is ON a vertex! */
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("\t\tThe point is ON the edge, calling joint_hitmiss2()\n");
        }
        joint_hitmiss2(closest, eu, code);
        return;
     } else {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("\t\tThe point is not on the edge\n");
        }
     }
@@ -332,7 +332,7 @@
     if (nmg_find_eu_leftvec(left, eu) < 0) bu_bomb("nmg_class_pt_e() bad LEFT 
vector\n");
 
     VSUB2(ptvec, pt, pca);             /* pt - pca */
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        VPRINT("\t\tptvec unnorm", ptvec);
        VPRINT("\t\tleft", left);
     }
@@ -340,7 +340,7 @@
 
     dot = VDOT(left, ptvec);
     if (NEAR_ZERO(dot, RT_DOT_TOL)) {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY)
+       if (nmg_debug & DEBUG_CLASSIFY)
            bu_log("\t\tpt lies on line of edge, outside verts. Skipping this 
edge\n");
        goto out;
     }
@@ -349,20 +349,20 @@
        closest->dist = dist;
        closest->p.eu = eu;
        closest->nmg_class = NMG_CLASS_AinB;
-       if (RTG.NMG_debug & DEBUG_CLASSIFY)
+       if (nmg_debug & DEBUG_CLASSIFY)
            bu_log("\t\tpt is left of edge, INSIDE loop, dot=%g\n", dot);
     } else {
        closest->dist = dist;
        closest->p.eu = eu;
        closest->nmg_class = NMG_CLASS_AoutB;
-       if (RTG.NMG_debug & DEBUG_CLASSIFY)
+       if (nmg_debug & DEBUG_CLASSIFY)
            bu_log("\t\tpt is right of edge, OUTSIDE loop\n");
     }
 
 out:
     /* XXX Temporary addition for chasing bug in Bradley r5 */
     /* XXX Should at least add DEBUG_PLOTEM check, later */
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        struct faceuse *fu;
        char buf[128];
        static int num;
@@ -419,14 +419,14 @@
     lg = lu->l_p->lg_p;
     NMG_CK_LOOP_G(lg);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        VPRINT("nmg_class_pt_l\tPt:", pt);
     }
 
     if (*lu->up.magic_p != NMG_FACEUSE_MAGIC)
        return;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        plane_t peqn;
        nmg_pr_lu_briefly(lu, 0);
        NMG_GET_FU_PLANE(peqn, lu->up.fu_p);
@@ -434,7 +434,7 @@
     }
 
     if (V3PT_OUT_RPP_TOL(pt, lg->min_pt, lg->max_pt, tol->dist)) {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("\tPoint is outside loop RPP\n");
        }
        closest->nmg_class = NMG_CLASS_AoutB;
@@ -464,7 +464,7 @@
                nmg_pr_orient(lu->orientation, "\t");
                bu_bomb("nmg_class_pt_l: bad orientation for face loopuse\n");
            }
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("\t\t closer to loop pt (%g, %g, %g)\n",
                       V3ARGS(lu_pt));
 
@@ -474,7 +474,7 @@
     } else {
        bu_bomb("nmg_class_pt_l() bad child of loopuse\n");
     }
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("nmg_class_pt_l\treturning, closest=%g %s\n",
               closest->dist, nmg_class_name(closest->nmg_class));
 }
@@ -521,7 +521,7 @@
     NMG_CK_FACE(fu->f_p);
     NMG_CK_FACE_G_PLANE(fu->f_p->g.plane_p);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("nmg_class_lu_fu(lu=%p) START\n", (void *)lu);
 
     /* Pick first vertex in loopuse, for point */
@@ -540,7 +540,7 @@
     vg = vu->v_p->vg_p;
     NMG_CK_VERTEX_G(vg);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        VPRINT("nmg_class_lu_fu\tPt:", vg->coord);
     }
 
@@ -569,7 +569,7 @@
        }
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("nmg_class_lu_fu(lu=%p) END, ret=%s\n",
               (void *)lu,
               nmg_class_name(nmg_class));
@@ -636,12 +636,12 @@
     NMG_CK_SHELL(s);
     BN_CK_TOL(tol);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("nmg_class_pt_s(): pt=(%g, %g, %g), s=%p\n",
               V3ARGS(pt), (void *)s);
     }
     if (V3PT_OUT_RPP_TOL(pt, s->sa_p->min_pt, s->sa_p->max_pt, tol->dist)) {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("nmg_class_pt_s(): OUT, point not in RPP\n");
        }
        return NMG_CLASS_AoutB;
@@ -735,7 +735,7 @@
 
     VUNITIZE(projection_dir);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("nmg_class_pt_s(): Pt=(%g, %g, %g) dir=(%g, %g, %g), 
reg_diam=%g\n",
               V3ARGS(pt), V3ARGS(projection_dir), region_diameter);
     }
@@ -762,7 +762,7 @@
        bu_free((char *)faces_seen, "nmg_class_pt_s faces_seen[]");
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("nmg_class_pt_s(): returning %s, s=%p, tries=%d\n",
               nmg_class_name(nmg_class), (void *)s, tries);
     }
@@ -790,7 +790,7 @@
 
     pt = vu->v_p->vg_p->coord;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("class_vu_vs_s(vu=%p, v=%p) pt=(%g, %g, %g)\n", (void *)vu, 
(void *)vu->v_p, V3ARGS(pt));
 
     /* As a mandatory consistency measure, check for cached classification */
@@ -846,7 +846,7 @@
        }
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("class_vu_vs_s(): Can't classify vertex via topology\n");
     }
 
@@ -859,7 +859,7 @@
      * topology if that had been the case.
      */
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        if ((sv = nmg_find_pt_in_shell(sB, pt, tol))) {
            bu_log("vu=%p, v=%p, sv=%p, pt=(%g, %g, %g)\n",
                   (void *)vu, (void *)vu->v_p, (void *)sv, V3ARGS(pt));
@@ -895,7 +895,7 @@
     }
 
 out:
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("class_vu_vs_s(vu=%p) return %s because %s\n",
               (void *)vu, nmg_class_status(status), reason);
     }
@@ -916,7 +916,7 @@
     vect_t e_min_pt;
     vect_t e_max_pt;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("class_eu_vs_s(eu=%p (e_p=%p, lu=%p), s=%p)\n",
               (void *)eu, (void *)eu->e_p, (void *)eu->up.lu_p, (void *)s);
        nmg_euprint("class_eu_vs_s\t", eu);
@@ -986,14 +986,14 @@
 
        nmg_pr_class_status("class_eu_vs_s(): eu vu", euv_cl);
        nmg_pr_class_status("class_eu_vs_s(): eumate vu", matev_cl);
-       if (RT_G_DEBUG || RTG.NMG_debug) {
+       if (RT_G_DEBUG || nmg_debug) {
            /* Do them over, so we can watch */
            bu_log("class_eu_vs_s(): Edge not cut, doing it over\n");
            NMG_INDEX_CLEAR(classlist[NMG_CLASS_AinB], eu->vu_p);
            NMG_INDEX_CLEAR(classlist[NMG_CLASS_AoutB], eu->vu_p);
            NMG_INDEX_CLEAR(classlist[NMG_CLASS_AinB], eu->eumate_p->vu_p);
            NMG_INDEX_CLEAR(classlist[NMG_CLASS_AoutB], eu->eumate_p->vu_p);
-           RTG.NMG_debug |= DEBUG_CLASSIFY;
+           nmg_debug |= DEBUG_CLASSIFY;
            (void)class_vu_vs_s(eu->vu_p, s, classlist, vlfree, tol);
            (void)class_vu_vs_s(eu->eumate_p->vu_p, s, classlist, vlfree, tol);
            nmg_euprint("class_eu_vs_s(): didn't this edge get cut?", eu);
@@ -1130,9 +1130,9 @@
     bu_bomb("class_eu_vs_s(): inconsistent edgeuse\n");
 
 out:
-    if (RTG.NMG_debug & DEBUG_GRAPHCL)
+    if (nmg_debug & DEBUG_GRAPHCL)
        nmg_show_broken_classifier_stuff((uint32_t *)eu, classlist, 
nmg_class_nothing_broken, 0, (char *)NULL, vlfree);
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("class_eu_vs_s(eu=%p) return %s because %s\n",
               (void *)eu, nmg_class_status(status), reason);
     }
@@ -1222,7 +1222,7 @@
        goto out;
     }
 
-    if (RTG.NMG_debug & DEBUG_BASIC) {
+    if (nmg_debug & DEBUG_BASIC) {
        bu_log("---- fu1, f=%p, flip=%d\n", (void *)fu1->f_p, fu1->f_p->flip);
        nmg_pr_fu_briefly(fu1, 0);
        bu_log("---- fu2, f=%p, flip=%d\n", (void *)fu2->f_p, fu2->f_p->flip);
@@ -1239,7 +1239,7 @@
     else
        ret = 1;                /* ON shared */
 out:
-    if (RTG.NMG_debug & DEBUG_BASIC) {
+    if (nmg_debug & DEBUG_BASIC) {
        bu_log("nmg_2lu_identical(eu1=%p, eu2=%p) ret=%d\n",
               (void *)eu1, (void *)eu2, ret);
     }
@@ -1265,7 +1265,7 @@
 
     NMG_CK_LOOPUSE(lu);
 
-    if (RTG.NMG_debug & DEBUG_BASIC) {
+    if (nmg_debug & DEBUG_BASIC) {
        bu_log("nmg_reclassify_lu_eu(lu=%p, classlist=%p, newclass=%s)\n",
               (void *)lu, (void *)classlist, nmg_class_name(newclass));
     }
@@ -1367,7 +1367,7 @@
     vect_t left;
     vect_t left_ref;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("class_shared_lu: classifying lu %p w.r.t. lu_ref %p\n",
               (void *)lu, (void *)lu_ref);
 
@@ -1397,7 +1397,7 @@
     }
 
     if (VDOT(left, left_ref) > SMALL_FASTF) {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("eu %p goes from v %p to v %p\n",
                   (void *)eu, (void *)eu->vu_p->v_p, (void 
*)eu->eumate_p->vu_p->v_p);
            bu_log("eu_ref %p goes from v %p to v %p\n",
@@ -1406,11 +1406,11 @@
 
        /* loop is either shared or anti */
        if (eu->vu_p->v_p == eu_ref->vu_p->v_p) {
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("class_shared_lu returning NMG_CLASS_AonBshared\n");
            return NMG_CLASS_AonBshared;
        } else {
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("class_shared_lu returning NMG_CLASS_AonBanti\n");
            return NMG_CLASS_AonBanti;
        }
@@ -1489,7 +1489,7 @@
        }
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("class_shared_lu returning NMG_CLASS_Unknown at end\n");
     return NMG_CLASS_Unknown;
 }
@@ -1512,7 +1512,7 @@
     int seen_error = 0;
     int status = 0;
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("class_lu_vs_s(lu=%p, s=%p)\n", (void *)lu, (void *)s);
 
     NMG_CK_LOOPUSE(lu);
@@ -1599,14 +1599,14 @@
            }
        }
 
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("class_lu_vs_s: Loopuse edges in:%d on:%d out:%d\n", in, on, 
outside);
        }
 
        if (in > 0 && outside > 0) {
            FILE *fp;
 
-           if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+           if (nmg_debug & DEBUG_CLASSIFY) {
                char buf[128];
                static int num;
                long *b;
@@ -1666,7 +1666,7 @@
        bu_bomb("class_lu_vs_s(): missing edgeuses\n");
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("class_lu_vs_s(): All edgeuses of loop are ON\n");
     }
 
@@ -1733,7 +1733,7 @@
            continue;
        }
 
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("\tfound radial lu (%p), check for match\n", (void *)q_lu);
        }
 
@@ -1751,11 +1751,11 @@
 
        found_match = 1;
        do {
-           if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+           if (nmg_debug & DEBUG_CLASSIFY) {
                bu_log("\t\tcompare vertex %p to vertex %p\n", (void 
*)eu1->vu_p->v_p, (void *)eu2->vu_p->v_p);
            }
            if (eu1->vu_p->v_p != eu2->vu_p->v_p) {
-               if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+               if (nmg_debug & DEBUG_CLASSIFY) {
                    bu_log("\t\t\tnot a match\n");
                }
                found_match = 0;
@@ -1767,7 +1767,7 @@
 
        if (!found_match) {
            /* check opposite direction */
-           if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+           if (nmg_debug & DEBUG_CLASSIFY) {
                bu_log("\tChecking for match in opposite direction\n");
            }
            eu1 = BU_LIST_FIRST(edgeuse, &lu->down_hd);
@@ -1781,11 +1781,11 @@
 
            found_match = 1;
            do {
-               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+               if (nmg_debug & DEBUG_CLASSIFY)
                    bu_log("\t\tcompare vertex %p to vertex %p\n",
                           (void *)eu1->vu_p->v_p, (void *)eu2->vu_p->v_p);
                if (eu1->vu_p->v_p != eu2->vu_p->v_p) {
-                   if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                   if (nmg_debug & DEBUG_CLASSIFY)
                        bu_log("\t\t\tnot a match\n");
                    found_match = 0;
                    break;
@@ -1798,7 +1798,7 @@
        if (found_match) {
            int test_class = NMG_CLASS_Unknown;
 
-           if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+           if (nmg_debug & DEBUG_CLASSIFY) {
                bu_log("\tFound a matching LU's %p and %p\n", (void *)lu, (void 
*)q_lu);
            }
 
@@ -1812,7 +1812,7 @@
                bu_bomb("class_lu_vs_s: FU has bad orientation\n");
            }
 
-           if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+           if (nmg_debug & DEBUG_CLASSIFY) {
                bu_log("\tclass_shared_lu says %s\n", 
nmg_class_name(test_class));
            }
 
@@ -1822,7 +1822,7 @@
                nmg_class = test_class;
            }
 
-           if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+           if (nmg_debug & DEBUG_CLASSIFY) {
                bu_log("\tclass set to %s\n",  nmg_class_name(nmg_class));
            }
 
@@ -1833,7 +1833,7 @@
     }
 
     if (nmg_class != NMG_CLASS_Unknown) {
-       if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+       if (nmg_debug & DEBUG_CLASSIFY) {
            bu_log("Final nmg_class = %s\n", nmg_class_name(nmg_class));
        }
        NMG_INDEX_SET(classlist[nmg_class], lu->l_p);
@@ -1854,7 +1854,7 @@
      * if the faceuse normal is pointing into the shell, we are inside.
      */
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("Checking radial faces:\n");
        nmg_pr_fu_around_eu(eu, tol);
     }
@@ -1868,7 +1868,7 @@
 
                if (p->up.lu_p->up.fu_p->orientation == OT_OPPOSITE) {
                    NMG_INDEX_SET(classlist[NMG_CLASS_AinB], lu->l_p);
-                   if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+                   if (nmg_debug & DEBUG_CLASSIFY) {
                        bu_log("Loop is INSIDE of fu %p\n", (void 
*)p->up.lu_p->up.fu_p);
                    }
                    reason = "radial faceuse is OT_OPPOSITE";
@@ -1877,7 +1877,7 @@
                    goto out;
                } else if (p->up.lu_p->up.fu_p->orientation == OT_SAME) {
                    NMG_INDEX_SET(classlist[NMG_CLASS_AoutB], lu->l_p);
-                   if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+                   if (nmg_debug & DEBUG_CLASSIFY) {
                        bu_log("Loop is OUTSIDEof fu %p\n", (void 
*)p->up.lu_p->up.fu_p);
                    }
                    reason = "radial faceuse is OT_SAME";
@@ -1892,7 +1892,7 @@
        } while (p != eu->eumate_p);
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("Loop is OUTSIDE 'cause it isn't anything else\n");
     }
 
@@ -1907,7 +1907,7 @@
     status = OUTSIDE;
 
 out:
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("class_lu_vs_s(lu=%p) return %s (%s) because %s\n",
               (void *)lu, nmg_class_status(status), nmg_class_name(nmg_class), 
reason);
     }
@@ -1930,7 +1930,7 @@
     NMG_CK_FACEUSE(fu);
     NMG_CK_SHELL(s);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        NMG_GET_FU_PLANE(n, fu);
        PLPRINT("\nclass_fu_vs_s plane equation:", n);
     }
@@ -1958,7 +1958,7 @@
        NMG_INDEX_SET(classlist[NMG_CLASS_AinB], fu->f_p);
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("class_fu_vs_s() END\n");
 }
 
@@ -1984,7 +1984,7 @@
     NMG_CK_SHELL(sB);
     BN_CK_TOL(tol);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY &&
+    if (nmg_debug & DEBUG_CLASSIFY &&
        BU_LIST_NON_EMPTY(&sA->fu_hd))
        bu_log("nmg_class_shells - doing faces\n");
 
@@ -1999,7 +1999,7 @@
            fu = BU_LIST_PNEXT(faceuse, fu);
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY &&
+    if (nmg_debug & DEBUG_CLASSIFY &&
        BU_LIST_NON_EMPTY(&sA->lu_hd))
        bu_log("nmg_class_shells - doing loops\n");
 
@@ -2014,7 +2014,7 @@
            lu = BU_LIST_PNEXT(loopuse, lu);
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY &&
+    if (nmg_debug & DEBUG_CLASSIFY &&
        BU_LIST_NON_EMPTY(&sA->eu_hd))
        bu_log("nmg_class_shells - doing edges\n");
 
@@ -2030,7 +2030,7 @@
     }
 
     if (sA->vu_p) {
-       if (RTG.NMG_debug)
+       if (nmg_debug)
            bu_log("nmg_class_shells - doing vertex\n");
        (void)class_vu_vs_s(sA->vu_p, sB, classlist, vlfree, tol);
     }
@@ -2184,7 +2184,7 @@
        }
     }
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY) {
+    if (nmg_debug & DEBUG_CLASSIFY) {
        bu_log("nmg_get_interior_pt: Couldn't find interior point for lu %p\n", 
(void *)lu);
        nmg_pr_lu_briefly(lu, "");
     }
@@ -2217,7 +2217,7 @@
     NMG_CK_LOOPUSE(lu2);
     BN_CK_TOL(tol);
 
-    if (RTG.NMG_debug & DEBUG_CLASSIFY)
+    if (nmg_debug & DEBUG_CLASSIFY)
        bu_log("nmg_classify_lu_lu(lu1=%p, lu2=%p)\n", (void *)lu1, (void 
*)lu2);
 
     if (lu1 == lu2 || lu1 == lu2->lumate_p)
@@ -2301,7 +2301,7 @@
            }
 
            if (share_edges && lu1_eu_count == lu2_eu_count) {
-               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+               if (nmg_debug & DEBUG_CLASSIFY)
                    bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AonBshared\n");
                return NMG_CLASS_AonBshared;
            } else {
@@ -2326,17 +2326,17 @@
                    nmg_class = nmg_class_pt_lu_except(vg->coord, lu2, (struct 
edge *)NULL, vlfree, tol);
                    if (nmg_class != NMG_CLASS_AonBshared && nmg_class != 
NMG_CLASS_AonBanti) {
                        if (lu2->orientation == OT_SAME) {
-                           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                           if (nmg_debug & DEBUG_CLASSIFY)
                                bu_log("nmg_classify_lu_lu returning %s\n", 
nmg_class_name(nmg_class));
                            return nmg_class;
                        } else {
                            if (nmg_class == NMG_CLASS_AinB) {
-                               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                               if (nmg_debug & DEBUG_CLASSIFY)
                                    bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AoutB\n");
                                return NMG_CLASS_AoutB;
                            }
                            if (nmg_class == NMG_CLASS_AoutB) {
-                               if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                               if (nmg_debug & DEBUG_CLASSIFY)
                                    bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AinB\n");
                                return NMG_CLASS_AinB;
                            }
@@ -2378,17 +2378,17 @@
                nmg_class = nmg_class_pt_lu_except(vg->coord, lu2, (struct edge 
*)NULL, vlfree, tol);
                if (nmg_class != NMG_CLASS_AonBshared && nmg_class != 
NMG_CLASS_AonBanti) {
                    if (lu2->orientation == OT_SAME) {
-                       if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                       if (nmg_debug & DEBUG_CLASSIFY)
                            bu_log("nmg_classify_lu_lu returning %s\n", 
nmg_class_name(nmg_class));
                        return nmg_class;
                    } else {
                        if (nmg_class == NMG_CLASS_AinB) {
-                           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                           if (nmg_debug & DEBUG_CLASSIFY)
                                bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AoutB\n");
                            return NMG_CLASS_AoutB;
                        }
                        if (nmg_class == NMG_CLASS_AoutB) {
-                           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                           if (nmg_debug & DEBUG_CLASSIFY)
                                bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AinB\n");
                            return NMG_CLASS_AinB;
                        }
@@ -2413,17 +2413,17 @@
                nmg_class = nmg_class_pt_lu_except(mid_pt, lu2, (struct edge 
*)NULL, vlfree, tol);
                if (nmg_class != NMG_CLASS_AonBshared && nmg_class != 
NMG_CLASS_AonBanti) {
                    if (lu2->orientation == OT_SAME) {
-                       if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                       if (nmg_debug & DEBUG_CLASSIFY)
                            bu_log("nmg_classify_lu_lu returning %s\n", 
nmg_class_name(nmg_class));
                        return nmg_class;
                    } else {
                        if (nmg_class == NMG_CLASS_AinB) {
-                           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                           if (nmg_debug & DEBUG_CLASSIFY)
                                bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AoutB\n");
                            return NMG_CLASS_AoutB;
                        }
                        if (nmg_class == NMG_CLASS_AoutB) {
-                           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+                           if (nmg_debug & DEBUG_CLASSIFY)
                                bu_log("nmg_classify_lu_lu returning 
NMG_CLASS_AinB\n");
                            return NMG_CLASS_AinB;
                        }
@@ -2445,11 +2445,11 @@
        vu2 = BU_LIST_FIRST(vertexuse, &lu2->down_hd);
 
        if (vu1->v_p == vu2->v_p) {
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("nmg_classify_lu_lu returning NMG_CLASS_AonBshared\n");
            return NMG_CLASS_AonBshared;
        } else {
-           if (RTG.NMG_debug & DEBUG_CLASSIFY)
+           if (nmg_debug & DEBUG_CLASSIFY)
                bu_log("nmg_classify_lu_lu returning NMG_CLASS_AoutB\n");
            return NMG_CLASS_AoutB;
        }
@@ -2474,7 +2474,7 @@
            else if (nmg_class == NMG_CLASS_AinB)
                nmg_class = NMG_CLASS_AoutB;
        }
-       if (RTG.NMG_debug & DEBUG_CLASSIFY)
+       if (nmg_debug & DEBUG_CLASSIFY)
            bu_log("nmg_classify_lu_lu returning %s\n", 
nmg_class_name(nmg_class));
        return nmg_class;
     } else if (BU_LIST_FIRST_MAGIC(&lu2->down_hd) == NMG_VERTEXUSE_MAGIC)

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c    2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c    2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -196,7 +196,7 @@
     NMG_CK_SHELL(sB);
     BN_CK_TOL(tol);
 
-    if (RTG.NMG_debug & DEBUG_BOOLEVAL) {
+    if (nmg_debug & DEBUG_BOOLEVAL) {
        bu_log("nmg_evaluate_boolean(sA=%p, sB=%p, op=%d) START\n",
               (void *)sA, (void *)sB, op);
     }
@@ -231,7 +231,7 @@
     bool_state.bs_isA = 0;
     nmg_eval_shell(sB, &bool_state);
 
-    if (RTG.NMG_debug & DEBUG_BOOLEVAL) {
+    if (nmg_debug & DEBUG_BOOLEVAL) {
        bu_log("nmg_evaluate_boolean(sA=%p, sB=%p, op=%d), evaluations done\n",
               (void *)sA, (void *)sB, op);
     }
@@ -241,7 +241,7 @@
     nmg_js(sA, sB, vlfree, tol);
 
     /* Plot the result */
-    if (RTG.NMG_debug & DEBUG_BOOLEVAL && RTG.NMG_debug & DEBUG_PLOTEM) {
+    if (nmg_debug & DEBUG_BOOLEVAL && nmg_debug & DEBUG_PLOTEM) {
        FILE *fp;
 
        if ((fp=fopen("bool_ans.plot3", "wb")) == (FILE *)NULL) {
@@ -331,7 +331,7 @@
     nmg_class = NMG_CLASS_BAD;
     ret = BACTION_RETAIN;
 out:
-    if (RTG.NMG_debug & DEBUG_BOOLEVAL) {
+    if (nmg_debug & DEBUG_BOOLEVAL) {
        bu_log("nmg_eval_action(ptr=%p) index=%d %s %s %s %s\n",
               (void *)ptr, index,
               bs->bs_isA ? "A" : "B",
@@ -365,7 +365,7 @@
     NMG_CK_SHELL(s);
     BN_CK_TOL(bs->bs_tol);
 
-    if (RTG.NMG_debug & DEBUG_VERIFY)
+    if (nmg_debug & DEBUG_VERIFY)
        nmg_vshell(&s->r_p->s_hd, s->r_p);
 
     /*
@@ -419,10 +419,10 @@
            lu = nextlu;
        }
 
-       if (RTG.NMG_debug & DEBUG_BOOLEVAL)
+       if (nmg_debug & DEBUG_BOOLEVAL)
            bu_log("faceuse %p loops retained=%d\n",
                   (void *)fu, loops_retained);
-       if (RTG.NMG_debug & DEBUG_VERIFY)
+       if (nmg_debug & DEBUG_VERIFY)
            nmg_vshell(&s->r_p->s_hd, s->r_p);
 
        /*
@@ -433,10 +433,10 @@
        if (BU_LIST_IS_EMPTY(&fu->lu_hd)) {
            if (loops_retained) bu_bomb("nmg_eval_shell() empty faceuse with 
retained loops?\n");
            /* faceuse is empty, face & mate die */
-           if (RTG.NMG_debug & DEBUG_BOOLEVAL)
+           if (nmg_debug & DEBUG_BOOLEVAL)
                bu_log("faceuse %p empty, kill\n", (void *)fu);
            nmg_kfu(fu);        /* kill face & mate, dequeue from shell */
-           if (RTG.NMG_debug & DEBUG_VERIFY)
+           if (nmg_debug & DEBUG_VERIFY)
                nmg_vshell(&s->r_p->s_hd, s->r_p);
            nmg_eval_plot(bs, nmg_eval_count++);        /* debug */
            fu = nextfu;
@@ -449,7 +449,7 @@
        }
        fu = nextfu;
     }
-    if (RTG.NMG_debug & DEBUG_VERIFY)
+    if (nmg_debug & DEBUG_VERIFY)
        nmg_vshell(&s->r_p->s_hd, s->r_p);
 
     /*
@@ -486,7 +486,7 @@
        }
        lu = nextlu;
     }
-    if (RTG.NMG_debug & DEBUG_VERIFY)
+    if (nmg_debug & DEBUG_VERIFY)
        nmg_vshell(&s->r_p->s_hd, s->r_p);
 
     /*
@@ -558,7 +558,7 @@
        }
        lu = nextlu;
     }
-    if (RTG.NMG_debug & DEBUG_VERIFY)
+    if (nmg_debug & DEBUG_VERIFY)
        nmg_vshell(&s->r_p->s_hd, s->r_p);
 
     /*
@@ -580,7 +580,7 @@
                bu_bomb("nmg_eval_shell() bad BACTION\n");
        }
     }
-    if (RTG.NMG_debug & DEBUG_VERIFY)
+    if (nmg_debug & DEBUG_VERIFY)
        nmg_vshell(&s->r_p->s_hd, s->r_p);
     nmg_eval_plot(bs, nmg_eval_count++);       /* debug */
 }
@@ -600,9 +600,9 @@
     int do_plot = 0;
     int do_anim = 0;
 
-    if (RTG.NMG_debug & DEBUG_BOOLEVAL && RTG.NMG_debug & DEBUG_PLOTEM)
+    if (nmg_debug & DEBUG_BOOLEVAL && nmg_debug & DEBUG_PLOTEM)
        do_plot = 1;
-    if (RTG.NMG_debug & DEBUG_PL_ANIM) do_anim = 1;
+    if (nmg_debug & DEBUG_PL_ANIM) do_anim = 1;
 
     if (!do_plot && !do_anim) return;
 
@@ -635,7 +635,7 @@
            void (*cfp)(struct bn_vlblock *, int, int);
            cfp = (void (*)(struct bn_vlblock *, int, 
int))nmg_vlblock_anim_upcall;
            cfp(vbp,
-               (RTG.NMG_debug&DEBUG_PL_SLOW) ? 250000 : 0,
+               (nmg_debug&DEBUG_PL_SLOW) ? 250000 : 0,
                0);
        } else {
            bu_log("null nmg_vlblock_anim_upcall, no animation\n");

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_extrude.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_extrude.c 2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_extrude.c 2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -420,7 +420,7 @@
 
     NMG_CK_SHELL(s);
 
-    if (RTG.NMG_debug & DEBUG_BASIC)
+    if (nmg_debug & DEBUG_BASIC)
        bu_log("nmg_fix_overlapping_loops: s = %p\n", (void *)s);
 
     /* this routine needs simple faceuses */
@@ -686,7 +686,7 @@
     }
     bu_ptbl_free(&loops);
 
-    if (RTG.NMG_debug & DEBUG_BASIC)
+    if (nmg_debug & DEBUG_BASIC)
        bu_log("nmg_fix_overlapping_loops: done\n");
 }
 
@@ -814,7 +814,7 @@
     NMG_CK_SHELL(in_shell);
     BN_CK_TOL(tol);
 
-    if (RTG.NMG_debug & DEBUG_BASIC)
+    if (nmg_debug & DEBUG_BASIC)
        bu_log("nmg_extrude_cleanup(in_shell=%p)\n", (void *)in_shell);
 
     m = nmg_find_model(&in_shell->l.magic);
@@ -997,7 +997,7 @@
     int is_void;
     int s_tmp_is_closed;
 
-    if (RTG.NMG_debug & DEBUG_BASIC)
+    if (nmg_debug & DEBUG_BASIC)
        bu_log("nmg_extrude_shell(s=%p, thick=%f)\n", (void *)s, thick);
 
     NMG_CK_SHELL(s);

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c    2016-10-11 23:30:56 UTC 
(rev 69029)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c    2016-10-11 23:57:55 UTC 
(rev 69030)
@@ -234,7 +234,7 @@
 
     vu = (struct vertexuse **)b->buffer;
 
-    if (RTG.NMG_debug) {
+    if (nmg_debug) {
        /* Ensure that distance from points to ray is reasonable */
        for (i = 0; i < b->end; ++i) {
            fastf_t dist;
@@ -245,7 +245,7 @@
                bu_log("WARNING ptbl_vsort() vu=%p point off line by %e %g*tol, 
tol=%e\n",
                       (void *)vu[i], dist,
                       dist/dist_tol, dist_tol);
-               if (RTG.NMG_debug&DEBUG_VU_SORT) {
+               if (nmg_debug&DEBUG_VU_SORT) {
                    VPRINT("  vu", vu[i]->v_p->vg_p->coord);
                    VPRINT("  pt", pt);
                    VPRINT(" dir", dir);
@@ -446,14 +446,14 @@
     if (this_ass == NMG_E_ASSESSMENT_ON_FORW) {
        if (in) ang = 0.0;      /* zero angle */
        else ang = M_PI;        /* 180 degrees */
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("nmg_vu_angle_measure:  NMG_E_ASSESSMENT_ON_FORW, ang=%g\n", 
ang);
        return ang;
     }
     if (this_ass == NMG_E_ASSESSMENT_ON_REV) {
        if (in) ang = M_PI;     /* 180 degrees */
        else ang = 0.0; /* zero angle */
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("nmg_vu_angle_measure:  NMG_E_ASSESSMENT_ON_REV, ang=%g\n", 
ang);
        return ang;
     }
@@ -469,7 +469,7 @@
        prev_eu = in ? BU_LIST_PPREV_CIRC(edgeuse, prev_eu) :
            BU_LIST_PNEXT_CIRC(edgeuse, prev_eu);
        if (prev_eu == this_eu) {
-           if (RTG.NMG_debug&DEBUG_VU_SORT)
+           if (nmg_debug&DEBUG_VU_SORT)
                bu_log("nmg_vu_angle_measure: prev eu is this eu, ang=0\n");
            return 0;   /* Unable to compute 'vec' */
        }
@@ -481,7 +481,7 @@
     VSUB2(vec, prev_eu->vu_p->v_p->vg_p->coord, vu->v_p->vg_p->coord);
 
     ang = bn_angle_measure(vec, x_dir, y_dir);
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("nmg_vu_angle_measure:  measured angle=%e\n", ang*RAD2DEG);
 
     /*
@@ -521,7 +521,7 @@
                   nmg_e_assessment_names[this_ass]);
        }
     }
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("  final ang=%g (%e), vec=(%g, %g, %g)\n", ang*RAD2DEG, 
ang*RAD2DEG, V3ARGS(vec));
     return ang;
 }
@@ -575,13 +575,13 @@
     }
     if (othereu == eu) {
        /* Back to where search started */
-       if (RTG.NMG_debug) nmg_pr_eu(eu, NULL);
+       if (nmg_debug) nmg_pr_eu(eu, NULL);
        bu_bomb("nmg_assess_eu() no edges leave the vertex!\n");
     }
     otherv = othereu->vu_p->v_p;
     if (otherv == v) {
        /* Edge stays on this vertex -- can't tell if forw or rev! */
-       if (RTG.NMG_debug) nmg_pr_eu(eu, NULL);
+       if (nmg_debug) nmg_pr_eu(eu, NULL);
        bu_bomb("nmg_assess_eu() edge runs from&to same vertex!\n");
     }
 
@@ -598,7 +598,7 @@
        fareu = othereu;
     again:
        /* Edge's far end is ON the ray.  Which way does it go? */
-       if (RTG.NMG_debug&DEBUG_FCUT)
+       if (nmg_debug&DEBUG_FCUT)
            bu_log("eu ON ray: vu[%d]=%p, other:vu[%d]=%p\n",
                   pos, (void *)rs->vu[pos], i, (void *)otherv);
 
@@ -616,7 +616,7 @@
        if (fareu == eu) goto really_on;        /* All eu's are ON! */
        if (fareu->g.lseg_p != eu->g.lseg_p) goto really_on;
        farv = fareu->vu_p->v_p;
-       if (RTG.NMG_debug&DEBUG_FCUT)
+       if (nmg_debug&DEBUG_FCUT)
            bu_log("nmg_assess_eu() farv = %p, on_index=%d\n", (void *)farv, 
nmg_is_v_on_rs_list(rs, farv));
        if (nmg_is_v_on_rs_list(rs, farv) > -1) {
            /* farv is ON list, try going further back */
@@ -625,7 +625,7 @@
        /* farv is not ON list, assess _it_ */
        /* XXX Need to remove othervu from the list! */
        otherv = farv;
-       if (RTG.NMG_debug&DEBUG_FCUT)
+       if (nmg_debug&DEBUG_FCUT)
            bu_log("nmg_assess_eu() assessing farv\n");
        goto left_right;
 
@@ -665,7 +665,7 @@
            if (rs->vu[i]->v_p == v ||
                rs->vu[i]->v_p == otherv)
                continue;
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("In edge interval (%d, %d), ON vertexuse [%d] = %p 
appears?\n",
                       start-1, end, i, (void *)rs->vu[i]);
                for (j=start-1; j<=end; j++) {
@@ -696,7 +696,7 @@
        ret = NMG_E_ASSESSMENT_LEFT;
     }
 out:
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("nmg_assess_eu(%p, fw=%d, pos=%d) v=%p otherv=%p: %s\n",
               (void *)eu, forw, pos, (void *)v, (void *)otherv,
               nmg_e_assessment_names[ret]);
@@ -768,7 +768,7 @@
            bu_bomb("nmg_assess_vu() ON/ON edgeuse ends on different 
vertices.\n");
        }
     }
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("nmg_assess_vu() vu[%d]=%p, v=%p: %s\n",
               pos, (void *)vu, (void *)vu->v_p, nmg_v_assessment_names[ass]);
     }
@@ -869,7 +869,7 @@
             * This is not WEDGE_ON
             * Call it WEDGE_CROSS.
             */
-           if (RTG.NMG_debug&DEBUG_VU_SORT)
+           if (nmg_debug&DEBUG_VU_SORT)
                bu_log("nmg_wedge_class() 0-angle wedge\n");
            ret = WEDGE_CROSS;
            goto out;
@@ -904,7 +904,7 @@
     /* A is left, B is RIGHT */
     ret = WEDGE_CROSS;
 out:
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        bu_log("nmg_wedge_class(%g, %g) = %s\n",
               a, b, WEDGECLASS2STR(ret));
     }
@@ -1062,7 +1062,7 @@
     }
     ret = WEDGE2_OVERLAP;                      /* ERROR */
 out:
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        bu_log(" a_in_cd=%d, b_in_cd=%d, c_in_ab=%d, d_in_ab=%d\n",
               a_in_cd, b_in_cd, c_in_ab, d_in_ab);
        bu_log("nmg_compare_2_wedges(%g, %g, %g, %g) = %d %s\n",
@@ -1103,7 +1103,7 @@
     double cand_hi;
     int candidate;
 
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("nmg_find_vu_in_wedge(start=%d, end=%d, lo=%g, hi=%g) START\n",
               start, end, lo_ang, hi_ang);
 
@@ -1118,14 +1118,14 @@
 
        NMG_CK_VERTEXUSE(vs[i].vu);
        if (skip_array[i]) {
-           if (RTG.NMG_debug&DEBUG_VU_SORT)
+           if (nmg_debug&DEBUG_VU_SORT)
                bu_log("Skipping index %d\n", i);
            continue;
        }
 
        /* Ignore wedges crossing, or on other side of line */
        if (vs[i].wedge_class != wclass && vs[i].wedge_class != WEDGE_ON) {
-           if (RTG.NMG_debug&DEBUG_VU_SORT) {
+           if (nmg_debug&DEBUG_VU_SORT) {
                bu_log("Seeking wedge_class=%s, [%d] has wedge_class %s\n",
                       WEDGECLASS2STR(wclass), i, 
WEDGECLASS2STR(vs[i].wedge_class));
            }
@@ -1160,7 +1160,7 @@
            /* This wedge AB is inside original wedge.
             * If candidate is -1, use AB as candidate.
             */
-           if (RTG.NMG_debug&DEBUG_VU_SORT)
+           if (nmg_debug&DEBUG_VU_SORT)
                bu_log("Initial candidate %d selected\n", i);
            candidate = i;
            cand_lo = vs[i].lo_ang;
@@ -1175,7 +1175,7 @@
            case WEDGE2_CD_IN_AB:
                /* This wedge AB contains candidate wedge CD, therefore
                 * this wedge is closer to original wedge */
-               if (RTG.NMG_debug&DEBUG_VU_SORT)
+               if (nmg_debug&DEBUG_VU_SORT)
                    bu_log("This candidate %d is closer\n", i);
                candidate = i;
                cand_lo = vs[i].lo_ang;
@@ -1184,7 +1184,7 @@
            case WEDGE2_NO_OVERLAP:
                /* No overlap, but both are inside.  Take lower angle */
                if (vs[i].lo_ang < cand_lo) {
-                   if (RTG.NMG_debug&DEBUG_VU_SORT)
+                   if (nmg_debug&DEBUG_VU_SORT)
                        bu_log("Taking lower angle %d\n", i);
                    candidate = i;
                    cand_lo = vs[i].lo_ang;
@@ -1192,13 +1192,13 @@
                }
                break;
            default:
-               if (RTG.NMG_debug&DEBUG_VU_SORT)
+               if (nmg_debug&DEBUG_VU_SORT)
                    bu_log("Continuing with search\n");
                continue;
        }
     }
 out:
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("nmg_find_vu_in_wedge(start=%d, end=%d, lo=%g, hi=%g) END 
candidate=%d\n",
               start, end, lo_ang, hi_ang,
               candidate);
@@ -1255,7 +1255,7 @@
            ret = 0;
            break;
     }
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        bu_log("nmg_is_wedge_before_cross() class2=%s, ret=%d\n",
               WEDGE2_TO_STRING(class2), ret);
     }
@@ -1404,7 +1404,7 @@
            break;
     }
 out:
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        bu_log("nmg_face_vu_compare(vu=%p, vu=%p) %s %s, %s\n",
               (void *)a->vu, (void *)b->vu,
               WEDGECLASS2STR(a->wedge_class),
@@ -1511,7 +1511,7 @@
 
     BN_CK_TOL(tol);
 
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        char buf[128];
        FILE *fp;
        struct model *m;
@@ -1582,7 +1582,7 @@
 
     class2 = nmg_compare_2_wedges(vs[outer_wedge].lo_ang, 
vs[outer_wedge].hi_ang,
                                  vs[inner_wedge].lo_ang, 
vs[inner_wedge].hi_ang);
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("+++nmg_special_wedge_processing() outer=%d, inner=%d, 
class2=%s\n", outer_wedge, inner_wedge, WEDGE2_TO_STRING(class2));
 
     inner_lu = nmg_find_lu_of_vu(vs[inner_wedge].vu);
@@ -1593,13 +1593,13 @@
        if (class2 == WEDGE2_IDENTICAL &&
            NEAR_EQUAL(vs[inner_wedge].hi_ang, vs[inner_wedge].lo_ang, 
WEDGE_ANG_TOL)
            ) {
-           if (RTG.NMG_debug&DEBUG_VU_SORT)
+           if (nmg_debug&DEBUG_VU_SORT)
                bu_log("nmg_special_wedge_processing:  inner and outer wedges 
from same loop, WEDGE2_IDENTICAL & 0deg spread, already in final form.\n");
            exclude[inner_wedge] = 1;   /* Don't return this wedge again */
            /* Don't need to recurse only because this is a crack */
            goto again_inner;
        }
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("nmg_special_wedge_processing:  inner and outer wedges from 
same loop, cutting loop\n");
        new_lu = nmg_cut_loop(vs[outer_wedge].vu, vs[inner_wedge].vu, vlfree);
        NMG_CK_LOOPUSE(new_lu);
@@ -1613,7 +1613,7 @@
 
     /* XXX Or they could be WEDGE2_IDENTICAL */
     /* XXX If WEDGE2_IDENTICAL, could we join and then simplify? */
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("wedge at vu[%d] is inside wedge at vu[%d]\n", inner_wedge, 
outer_wedge);
 
     if (outer_lu->orientation == inner_lu->orientation) {
@@ -1621,7 +1621,7 @@
         * Two loops meet at this vu.  Joining them will impose
         * a natural edgeuse ordering onto the vu's.
         */
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("joining loops\n");
        vs[inner_wedge].vu = nmg_join_2loops(vs[outer_wedge].vu,
                                             vs[inner_wedge].vu);
@@ -1641,7 +1641,7 @@
      * and have nothing complex inside the wedge of the inner loop.
      * Join inner and outer loops here, to impose a proper vu ordering.
      */
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("Inner wedge is simple, join inner and outer loops.\n");
 
     vs[inner_wedge].vu = nmg_join_2loops(vs[outer_wedge].vu,
@@ -1672,7 +1672,7 @@
     int l;
     int retries = 0;
 
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("nmg_face_coincident_vu_sort(, %d, %d) START\n", start, end);
 
     NMG_CK_RAYSTATE(rs);
@@ -1694,7 +1694,7 @@
        lu = nmg_find_lu_of_vu(rs->vu[i]);
        NMG_CK_LOOPUSE(lu);
        ass = nmg_assess_vu(rs, i);
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("vu[%d]=%p v=%p assessment=%s\n",
                   i, (void *)rs->vu[i], (void *)rs->vu[i]->v_p, 
nmg_v_assessment_names[ass]);
        /* Ignore lone vertices, unless that is all that there is,
@@ -1729,7 +1729,7 @@
            vs[nvu].out_vu_angle = 360;
 
        vs[nvu].wedge_class = nmg_wedge_class(ass, vs[nvu].in_vu_angle, 
vs[nvu].out_vu_angle);
-       if (RTG.NMG_debug&DEBUG_VU_SORT) bu_log("nmg_wedge_class = %d %s\n", 
vs[nvu].wedge_class, WEDGECLASS2STR(vs[nvu].wedge_class));
+       if (nmg_debug&DEBUG_VU_SORT) bu_log("nmg_wedge_class = %d %s\n", 
vs[nvu].wedge_class, WEDGECLASS2STR(vs[nvu].wedge_class));
        /* Sort the angles (Don't forget to sort for CROSS case too) */
        if ((vs[nvu].wedge_class == WEDGE_LEFT && vs[nvu].in_vu_angle > 
vs[nvu].out_vu_angle) ||
            (vs[nvu].wedge_class != WEDGE_LEFT && vs[nvu].in_vu_angle < 
vs[nvu].out_vu_angle)) {
@@ -1798,18 +1798,18 @@
 
     /* Here is where the special wedge-breaking code goes */
     if (nmg_special_wedge_processing(vs, 0, nvu, 0.0, 180.0, WEDGE_RIGHT, (int 
*)0, vlfree, rs->tol)) {
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("*** nmg_face_coincident_vu_sort(, %d, %d) restarting after 
0--180 wedge\n", start, end);
        goto top;
     }
     /* XXX reclass on/on edges from WEDGE_RIGHT to WEDGE_LEFT here? */
     if (nmg_special_wedge_processing(vs, 0, nvu, 360.0, 180.0, WEDGE_LEFT, 
(int *)0, vlfree, rs->tol)) {
-       if (RTG.NMG_debug&DEBUG_VU_SORT)
+       if (nmg_debug&DEBUG_VU_SORT)
            bu_log("*** nmg_face_coincident_vu_sort(, %d, %d) restarting after 
180-360 wedge\n", start, end);
        goto top;
     }
 
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        bu_log("Loop table (before sort):\n");
        for (l = 0; l < nloop; l++) {
            bu_log("  index=%d, lu=%p, min_dot=%g, #vu=%d\n",
@@ -1822,7 +1822,7 @@
     bu_sort((void *)vs, (unsigned)nvu, (unsigned)sizeof(*vs),
            nmg_face_vu_compare, NULL);
 
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        bu_log("Vertexuse table (after sort):\n");
        for (i = 0; i < nvu; i++) {
            bu_log("  %p, l=%d, in/o=(%g, %g), lo/hi=(%g, %g), %s, sq=%d\n",
@@ -1840,7 +1840,7 @@
            rs->vu[start+i] = vs[i].vu;
        }
     }
-    if (RTG.NMG_debug&DEBUG_VU_SORT) {
+    if (nmg_debug&DEBUG_VU_SORT) {
        for (i = 0; i < nvu; i++) {
            bu_log(" vu[%d]=%p, v=%p\n",
                   start+i, (void *)rs->vu[start+i], (void 
*)rs->vu[start+i]->v_p);
@@ -1850,7 +1850,7 @@
     bu_free((char *)vs, "nmg_vu_stuff");
     bu_free((char *)ls, "nmg_loop_stuff");
 
-    if (RTG.NMG_debug&DEBUG_VU_SORT)
+    if (nmg_debug&DEBUG_VU_SORT)
        bu_log("nmg_face_coincident_vu_sort(, %d, %d) END, ret=%d\n", start, 
end, start+nvu);
 
     return start+nvu;
@@ -1936,7 +1936,7 @@
        default:
            bu_bomb("nmg_face_rs_init: bad orientation\n");
     }
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        struct loopuse *lu;
        struct edgeuse *eu;
        struct vertexuse *vu;
@@ -2016,7 +2016,7 @@
     if (eu->g.lseg_p) NMG_CK_EDGE_G_LSEG(eu->g.lseg_p);
     if (rs->eg_p) NMG_CK_EDGE_G_LSEG(rs->eg_p);
 
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("nmg_edge_geom_isect_line(eu=%p, %s)\n eu->g=%p, rs->eg=%p at 
START\n",
               (void *)eu, reason,
               (void *)eu->g.magic_p, (void *)rs->eg_p);
@@ -2058,7 +2058,7 @@
     nmg_jeg(rs->eg_p, eu->g.lseg_p);
 out:
     NMG_CK_EDGE_G_LSEG(rs->eg_p);
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("nmg_edge_geom_isect_line(eu=%p) g=%p, rs->eg=%p at END\n",
               (void *)eu, (void *)eu->g.magic_p, (void *)rs->eg_p);
     }
@@ -2079,7 +2079,7 @@
     size_t i, j, k;
     int done = 0;
 
-    if (RTG.NMG_debug&DEBUG_FCUT)
+    if (nmg_debug&DEBUG_FCUT)
        bu_log("find_loop_to_cut: prior_start=%d, prior_end=%d, next_start=%d, 
next_end=%d, rs=%p\n",
               prior_start, prior_end, next_start, next_end, (void *)rs);
 
@@ -2162,7 +2162,7 @@
            lcut = (struct loop_cuts *)BU_PTBL_GET(cuts, k);
            match_lu = lcut->lu;
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tfind_loop_to_cut: matching lu's = %p\n", (void 
*)match_lu);
            lu1 = match_lu;
            for (i=prior_start; i < prior_end; i++) {
@@ -2184,7 +2184,7 @@
            }
        }
     } else {
-       if (RTG.NMG_debug&DEBUG_FCUT)
+       if (nmg_debug&DEBUG_FCUT)
            bu_log("\tfind_loop_to_cut returning 0\n");
        return (struct bu_ptbl *)NULL;
     }
@@ -2207,7 +2207,7 @@
            vect_t x_dir, y_dir;
            vect_t norm;
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tfind_loop_to_cut: %d VU's from lu %p\n", count, (void 
*)lu2);
 
            /* need to select correct VU */
@@ -2221,7 +2221,7 @@
            VCROSS(y_dir, norm, x_dir);
            VUNITIZE(y_dir);
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tx_dir=(%g %g %g), y_dir=(%g %g %g)\n",
                       V3ARGS(x_dir), V3ARGS(y_dir));
 
@@ -2246,13 +2246,13 @@
                VSUB2(eu_dir, eu->eumate_p->vu_p->v_p->vg_p->coord, 
eu->vu_p->v_p->vg_p->coord);
                angle = atan2(VDOT(y_dir, eu_dir), VDOT(x_dir, eu_dir));
 
-               if (RTG.NMG_debug&DEBUG_FCUT)
+               if (nmg_debug&DEBUG_FCUT)
                    bu_log("\tangle for eu %p (vu=%p, #%d) is %g\n",
                           (void *)eu, (void *)rs->vu[i], i, angle);
 
                /* select max angle */
                if (angle > vu_angle) {
-                   if (RTG.NMG_debug&DEBUG_FCUT)
+                   if (nmg_debug&DEBUG_FCUT)
                        bu_log("\t\tabove is the new best VU\n");
                    vu_angle = angle;
                    vu_best = rs->vu[i];
@@ -2265,7 +2265,7 @@
                lcut->vu2 = vu2;
            }
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tfind_loop_to_cut: selecting VU2 %p\n", (void *)vu2);
        }
 
@@ -2340,7 +2340,7 @@
            vect_t x_dir, y_dir;
            vect_t norm;
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tfind_loop_to_cut: %d VU's from lu %p\n", count, (void 
*)lu1);
 
            /* need to select correct VU */
@@ -2354,7 +2354,7 @@
            VCROSS(y_dir, norm, x_dir);
            VUNITIZE(y_dir);
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tx_dir=(%g %g %g), y_dir=(%g %g %g)\n",
                       V3ARGS(x_dir), V3ARGS(y_dir));
 
@@ -2378,13 +2378,13 @@
                VSUB2(eu_dir, eu->eumate_p->vu_p->v_p->vg_p->coord, 
eu->vu_p->v_p->vg_p->coord);
                angle = atan2(VDOT(y_dir, eu_dir), VDOT(x_dir, eu_dir));
 
-               if (RTG.NMG_debug&DEBUG_FCUT)
+               if (nmg_debug&DEBUG_FCUT)
                    bu_log("\tangle for eu %p (vu=%p, #%d) is %g\n",
                           (void *)eu, (void *)rs->vu[i], i, angle);
 
                /* select max angle */
                if (angle > vu_angle) {
-                   if (RTG.NMG_debug&DEBUG_FCUT)
+                   if (nmg_debug&DEBUG_FCUT)
                        bu_log("\t\tabove is the new best VU\n");
                    vu_angle = angle;
 
@@ -2398,12 +2398,12 @@
                lcut->vu1 = vu1;
            }
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("\tfind_loop_to_cut: selecting VU1 %p\n", (void *)vu1);
        }
     }
 
-    if (RTG.NMG_debug&DEBUG_FCUT)
+    if (nmg_debug&DEBUG_FCUT)
        bu_log("\tfind_loop_to_cut: returning %ld cuts (index1=%d, 
index2=%d)\n",
               BU_PTBL_LEN(cuts), *index1, *index2);
 
@@ -2456,7 +2456,7 @@
     int nmg_class;
     int i;
 
-    if (RTG.NMG_debug&DEBUG_FCUT)
+    if (nmg_debug&DEBUG_FCUT)
        bu_log("find_best_vu: start=%d, end=%d, other_vp=%p, rs=%p\n",
               start, end, (void *)other_vp, (void *)rs);
 
@@ -2464,7 +2464,7 @@
     NMG_CK_RAYSTATE(rs);
 
     if (start == end-1) {
-       if (RTG.NMG_debug&DEBUG_FCUT)
+       if (nmg_debug&DEBUG_FCUT)
            bu_log("\tfind_best_vu returning %d\n", start);
 
        return start;
@@ -2493,7 +2493,7 @@
            other_is_in_best = 0;
     }
 
-    if (RTG.NMG_debug&DEBUG_FCUT)
+    if (nmg_debug&DEBUG_FCUT)
        bu_log("\tfind_best_vu: first choice is index=%d, vu=%p, lu=%p, 
other_is_in_best=%d\n",
               best_index, (void *)best_vu, (void *)best_lu, other_is_in_best);
 
@@ -2503,7 +2503,7 @@
        lu = nmg_find_lu_of_vu(rs->vu[i]);
        if (lu != best_lu) {
            nmg_class = nmg_classify_lu_lu(lu, best_lu, vlfree, rs->tol);
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("lu %p is %s\n", (void *)lu, 
nmg_orientation(lu->orientation));
                bu_log("best_lu %p is %s\n", (void *)best_lu, 
nmg_orientation(best_lu->orientation));
                bu_log("lu %p is %s w.r.t lu %p\n",
@@ -2517,7 +2517,7 @@
                    best_lu = lu;
                    best_index = i;
 
-                   if (RTG.NMG_debug&DEBUG_FCUT)
+                   if (nmg_debug&DEBUG_FCUT)
                        bu_log("\tfind_best_vu: better choice (inside) - 
index=%d, vu=%p, lu=%p, other_is_in_best=%d\n",
                               best_index, (void *)best_vu, (void *)best_lu, 
other_is_in_best);
                    /* other_is_in_best can't change */
@@ -2547,7 +2547,7 @@
                        } else
                            other_is_in_best = 0;
                    }
-                   if (RTG.NMG_debug&DEBUG_FCUT)
+                   if (nmg_debug&DEBUG_FCUT)
                        bu_log("\tfind_best_vu: better choice (outside) - 
index=%d, vu=%p, lu=%p, other_is_in_best=%d\n",
                               best_index, (void *)best_vu, (void *)best_lu, 
other_is_in_best);
                }
@@ -2560,7 +2560,7 @@
            NMG_CK_EDGEUSE(eu);
            angle = nmg_eu_angle(eu, other_vp);
 
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("best_angle = %f, eu=%p, eu_angle=%f\n",
                       best_angle, (void *)eu, angle);
            if (angle > best_angle) {
@@ -2596,7 +2596,7 @@
     NMG_CK_RAYSTATE(rs);
     BN_CK_TOL(rs->tol);
 
-    if (RTG.NMG_debug&DEBUG_FCUT)
+    if (nmg_debug&DEBUG_FCUT)
        bu_log("nmg_face_combine()\n");
 
     if (rs->eg_p) NMG_CK_EDGE_G_LSEG(rs->eg_p);
@@ -2608,7 +2608,7 @@
     nmg_face_plot(rs->fu2);
 #endif
 
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("rs->fu1 = %p\n", (void *)rs->fu1);
        bu_log("rs->fu2 = %p\n", (void *)rs->fu2);
        nmg_pr_fu_briefly(rs->fu1, "");
@@ -2657,7 +2657,7 @@
        next_end = next_start;
        while (++next_end < (size_t)rs->nvu && rs->vu[next_end]->v_p == 
vu2->v_p);
 
-       if (RTG.NMG_debug&DEBUG_FCUT) {
+       if (nmg_debug&DEBUG_FCUT) {
            bu_log("rs->fu1 = %p\n", (void *)rs->fu1);
            bu_log("rs->fu2 = %p\n", (void *)rs->fu2);
            bu_log("prior_start=%d. prior_end=%d, next_start=%d, next_end=%d\n",
@@ -2672,7 +2672,7 @@
        if (nmg_find_eu_in_face(vu1->v_p, vu2->v_p, rs->fu1,
                                (struct edgeuse *)NULL, 0))
        {
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("Already an edge here\n");
            continue;
        }
@@ -2680,7 +2680,7 @@
        if (nmg_find_eu_in_face(vu1->v_p, vu2->v_p, rs->fu1->fumate_p,
                                (struct edgeuse *)NULL, 0))
        {
-           if (RTG.NMG_debug&DEBUG_FCUT)
+           if (nmg_debug&DEBUG_FCUT)
                bu_log("Already an edge here\n");
            continue;
        }
@@ -2695,7 +2695,7 @@
                                               (void (*)(struct vertexuse *, 
point_t, const char *))NULL,
                                               (const char *)NULL, 0, 1, 
vlfree, rs->tol);
 
-       if (RTG.NMG_debug&DEBUG_FCUT) {
+       if (nmg_debug&DEBUG_FCUT) {
            bu_log("vu1=%p (%g %g %g), vu2=%p (%g %g %g)\n",
                   (void *)vu1, V3ARGS(vu1->v_p->vg_p->coord),
                   (void *)vu2, V3ARGS(vu2->v_p->vg_p->coord));
@@ -2740,7 +2740,7 @@
            for (cut_no = 0; cut_no < BU_PTBL_LEN(cuts); cut_no++) {
                struct loop_cuts *lcut;
 
-               if (RTG.NMG_debug&DEBUG_FCUT)
+               if (nmg_debug&DEBUG_FCUT)
                    bu_log("\tcut loop (#%d of %ld)\n", cut_no, 
BU_PTBL_LEN(cuts));
 
                lcut = (struct loop_cuts *)BU_PTBL_GET(cuts, cut_no);
@@ -2763,7 +2763,7 @@
                nmg_lu_reorient(lu1);
                nmg_lu_reorient(new_lu);
 
-               if (RTG.NMG_debug&DEBUG_FCUT) {
+               if (nmg_debug&DEBUG_FCUT) {
                    bu_log("\t\t new_eu = %p\n", (void *)new_eu1);
                    nmg_pr_fu_briefly(rs->fu1, "");
                }
@@ -2806,7 +2806,7 @@
            lu1->orientation = OT_SAME;
            lu1->lumate_p->orientation = OT_SAME;
 
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("\tjoin 2 singvu loops\n");
                nmg_pr_fu_briefly(rs->fu1, "");
            }
@@ -2840,7 +2840,7 @@
            lu2->orientation = orient2;
            lu2->lumate_p->orientation = orient2;
 
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("\tjoin loops vu1 (%p) is sing vu loop\n", (void *)vu1);
                nmg_pr_fu_briefly(rs->fu1, "");
            }
@@ -2878,7 +2878,7 @@
            lu1->orientation = orient1;
            lu1->lumate_p->orientation = orient1;
 
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("\tjoin loops vu2 (%p) is sing vu loop\n", (void *)vu2);
                nmg_pr_fu_briefly(rs->fu1, "");
            }
@@ -2909,7 +2909,7 @@
 
            nmg_loop_g(lu1->l_p, rs->tol);
 
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("\t join 2 loops\n");
                bu_log("\t\tvu2 (%p) replaced with new_vu2 %p\n", (void *)vu2, 
(void *)new_vu2);
                nmg_pr_fu_briefly(rs->fu1, "");
@@ -2931,7 +2931,7 @@
        bu_bomb("ERROR: face cutter didn't cut anything");
     }
 
-    if (RTG.NMG_debug&DEBUG_FCUT)
+    if (nmg_debug&DEBUG_FCUT)
        nmg_pr_fu_briefly(rs->fu1, "");
 }
 
@@ -2991,7 +2991,7 @@
        v = vu->v_p;
        NMG_CK_VERTEX(v);
        if ((zot = nmg_assess_eu(vu->up.eu_p, 0, rs, i)) < 0) {
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("nmg_onon_fix(): vu[%d] zapped (rev)\n", -zot);
            }
        doit:
@@ -3006,7 +3006,7 @@
        }
 
        if ((zot = nmg_assess_eu(vu->up.eu_p, 1, rs, i)) < 0) {
-           if (RTG.NMG_debug&DEBUG_FCUT) {
+           if (nmg_debug&DEBUG_FCUT) {
                bu_log("nmg_onon_fix(): vu[%d] zapped (forw)\n", -zot);
            }
            goto doit;
@@ -3084,7 +3084,7 @@
     struct nmg_ray_state rs1;
     struct nmg_ray_state rs2;
 
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("\nnmg_face_cutjoin(fu1=%p, fu2=%p) eg=%p START\n", (void *)fu1, 
(void *)fu2, (void *)eg);
     }
 
@@ -3093,7 +3093,7 @@
     NMG_CK_FACEUSE(fu2);
 
     /* Perhaps this should only happen when debugging is on? */
-    if (RTG.NMG_debug&DEBUG_FCUT && (b1->end <= 0 || b2->end <= 0)) {
+    if (nmg_debug&DEBUG_FCUT && (b1->end <= 0 || b2->end <= 0)) {
        bu_log("nmg_face_cutjoin(fu1=%p, fu2=%p): WARNING empty list %ld %ld\n",
               (void *)fu1, (void *)fu2, b1->end, b2->end);
     }
@@ -3110,7 +3110,7 @@
     vu2 = (struct vertexuse **)b2->buffer;
 
     /* Print list of intersections */
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {
        bu_log("Ray vu intersection list:\n");
        for (i = 0; (off_t)i < b1->end; i++) {
            bu_log(" %d %e ", i, mag1[i]);
@@ -3128,7 +3128,7 @@
 
     /* this block of code checks if the two lists of intersection vertexuses
      * contain vertexuses from the appropriate faceuse */
-    if (RTG.NMG_debug&DEBUG_FCUT) {
+    if (nmg_debug&DEBUG_FCUT) {

@@ 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to