Revision: 73160
          http://sourceforge.net/p/brlcad/code/73160
Author:   starseeker
Date:     2019-05-23 18:22:05 +0000 (Thu, 23 May 2019)
Log Message:
-----------
Don't bother copying if we can't work on this Brep successfully

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/cdt.cpp

Modified: brlcad/trunk/src/libbrep/cdt.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt.cpp    2019-05-23 18:20:10 UTC (rev 73159)
+++ brlcad/trunk/src/libbrep/cdt.cpp    2019-05-23 18:22:05 UTC (rev 73160)
@@ -355,11 +355,6 @@
     ON_wString wstr;
     ON_TextLog tl(wstr);
 
-    if (!s_cdt->brep) {
-       s_cdt->brep = new ON_Brep(*s_cdt->orig_brep);
-    }
-    ON_Brep* brep = s_cdt->brep;
-
     // Check for any conditions that are show-stoppers
     ON_wString wonstr;
     ON_TextLog vout(wonstr);
@@ -377,6 +372,13 @@
         }
     }
 
+    // We may be changing the ON_Brep data, so work on a copy
+    // rather than the original object
+    if (!s_cdt->brep) {
+       s_cdt->brep = new ON_Brep(*s_cdt->orig_brep);
+    }
+    ON_Brep* brep = s_cdt->brep;
+
     // Have observed at least one case (NIST2 face 237) where a small face on a
     // large surface resulted in a valid 2D triangulation that produced a
     // self-intersecting 3D mesh.  Attempt to minimize situations where 2D and

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