Revision: 57316
          http://sourceforge.net/p/brlcad/code/57316
Author:   brlcad
Date:     2013-08-30 14:07:43 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
modify the code in reponse to a forum discussion (362511/thread/2283b056) where 
a logic failure was noticed.  if there's no tessellate function, it falls 
through and will bomb on NMG_CK_REGION.

Modified Paths:
--------------
    brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2013-08-30 14:07:23 UTC 
(rev 57315)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2013-08-30 14:07:43 UTC 
(rev 57316)
@@ -1196,20 +1196,28 @@
     union tree *curtree;
     struct directory *dp;
 
+    if (!tsp || !pathp || !ip)
+       return TREE_NULL;
+
+    RT_CK_DB_INTERNAL(ip);
+    RT_CK_FULL_PATH(pathp);
+    dp = DB_FULL_PATH_CUR_DIR(pathp);
+    RT_CK_DIR(dp);
+
+    if (!ip->idb_meth || !ip->idb_meth->ft_tessellate) {
+       bu_log("ERROR(%s): tessellation support not available\n", dp->d_namep);
+       return TREE_NULL;
+    }
+
     NMG_CK_MODEL(*tsp->ts_m);
     BN_CK_TOL(tsp->ts_tol);
     RT_CK_TESS_TOL(tsp->ts_ttol);
-    RT_CK_DB_INTERNAL(ip);
     RT_CK_RESOURCE(tsp->ts_resp);
 
-    RT_CK_FULL_PATH(pathp);
-    dp = DB_FULL_PATH_CUR_DIR(pathp);
-    RT_CK_DIR(dp);
-
     m = nmg_mm();
 
-    if (ip->idb_meth && ip->idb_meth->ft_tessellate && 
ip->idb_meth->ft_tessellate(&r1, m, ip, tsp->ts_ttol, tsp->ts_tol) < 0) {
-       bu_log("nmg_booltree_leaf_tess(%s): tessellation failure\n", 
dp->d_namep);
+    if (ip->idb_meth->ft_tessellate(&r1, m, ip, tsp->ts_ttol, tsp->ts_tol) < 
0) {
+       bu_log("ERROR(%s): tessellation failure\n", dp->d_namep);
        return TREE_NULL;
     }
 

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


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to