Revision: 38943
          http://brlcad.svn.sourceforge.net/brlcad/?rev=38943&view=rev
Author:   starseeker
Date:     2010-05-03 20:57:21 +0000 (Mon, 03 May 2010)

Log Message:
-----------
Add Bob's script for swapping BoTs from facetall.sh into a tree instead of the 
CSG booleans - not turning this on as a command in MGED by default yet, but put 
it in so it can be sourced if needed.  Need to decide later how to expose this 
functionality for the user - maybe wrapping both facetall and rrmb logic into 
an option in a future bot command?

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/mged/Makefile.am

Added Paths:
-----------
    brlcad/trunk/src/tclscripts/mged/rrmb.tcl

Modified: brlcad/trunk/src/tclscripts/mged/Makefile.am
===================================================================
--- brlcad/trunk/src/tclscripts/mged/Makefile.am        2010-05-03 13:58:46 UTC 
(rev 38942)
+++ brlcad/trunk/src/tclscripts/mged/Makefile.am        2010-05-03 20:57:21 UTC 
(rev 38943)
@@ -76,6 +76,7 @@
        reid.tcl \
        remap_mater.tcl \
        remat.tcl \
+       rrmb.tcl \
        rt.tcl \
        rt_script.tcl \
        sample.tcl \

Added: brlcad/trunk/src/tclscripts/mged/rrmb.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/mged/rrmb.tcl                           (rev 0)
+++ brlcad/trunk/src/tclscripts/mged/rrmb.tcl   2010-05-03 20:57:21 UTC (rev 
38943)
@@ -0,0 +1,52 @@
+#
+#                        R R M B . T C L
+# BRL-CAD
+#
+# Copyright (c) 2010 United States Government as represented by
+# the U.S. Army Research Laboratory.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this file; see the file named COPYING for more
+# information.
+#
+###
+#
+# Description -
+#
+# Replace Region Members with Bot
+#
+# This proc looks for bots created by the facetall.sh script
+# and substitutes them in as the sole members of the respective
+# regions that were used to create them.
+#
+
+set glob_compat_mode 0
+
+proc rrmb {{_unclaimed unclaimed}} {
+    foreach bot [expand *.bot] {
+       regexp {(.*)\.bot} $bot match rname
+
+       if {[catch {get $rname id} rid]} {
+           set rid ""
+       }
+
+       if {$rid != ""} {
+           # Replace tree with a bot leaf
+           adjust $rname tree [list l $bot]
+       } else {
+           catch {
+               r $rname u $bot
+               g $_unclaimed $rname
+           }
+       }
+    }
+}


Property changes on: brlcad/trunk/src/tclscripts/mged/rrmb.tcl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to