[cgma-dev] r2509 - cgm/trunk/geom/OCC

janehu at mcs.anl.gov janehu at mcs.anl.gov
Tue Jan 6 15:19:07 CST 2009


Author: janehu
Date: 2009-01-06 15:19:07 -0600 (Tue, 06 Jan 2009)
New Revision: 2509

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
Modified for testing on webcut function.

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-01-06 21:17:39 UTC (rev 2508)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-01-06 21:19:07 UTC (rev 2509)
@@ -4477,11 +4477,25 @@
   }
 
   if(imprint)
-    stat =  this->imprint( new_BodySMs, results_list, false);
+  {
+    BodySM* new_body1, *new_body2;
+    for(int i = 0; i < new_BodySMs.size()-1; i ++)
+    {
+      BodySM* body1 = new_BodySMs[i];
+      for(int j = i+1; j < new_BodySMs.size(); j++)
+      {
+        BodySM* body2 = new_BodySMs[j];
+        stat =  this->imprint( body1, body2, new_body1, new_body2, false);
+        if(new_body1 && body1 != new_body1)
+          new_BodySMs[i] = new_body1;
+        if(new_body2 && body2 != new_body2)
+          new_BodySMs[j] = new_body2; 
+      }
+    }
+  }
 
-  else
-    results_list = new_BodySMs;
-  return stat;  
+  results_list = new_BodySMs;
+  return CUBIT_SUCCESS;  
 }
 
 //===============================================================================
@@ -4651,7 +4665,8 @@
   v1 = point_2 - point_1;
   v2 = point_3 - point_1; 
   normal = ~(v1 * v2); 
-  if(normal.length() != 1)
+  double tol = OCCQueryEngine::instance()->get_sme_resabs_tolerance(); 
+  if(fabs(normal.length() - 1) > tol)
   {
      PRINT_ERROR("The three points are co-linear, and can't be used as a cutting plane.\n");
      return CUBIT_FAILURE;




More information about the cgma-dev mailing list