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

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Tue Dec 6 12:29:38 CST 2011


Author: janehu
Date: 2011-12-06 12:29:33 -0600 (Tue, 06 Dec 2011)
New Revision: 5237

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Partially fixed the mcnp2cad/torus testcase, in that the thinner torus get imprinted correctly now, but the thicker torus failed at unite operation. This has been reported in opencascade forus with thread number 22294, and has been accept as a bug with number 22829. Details at http://www.opencascade.org/org/forum/thread_22294/

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2011-12-05 21:08:31 UTC (rev 5236)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2011-12-06 18:29:33 UTC (rev 5237)
@@ -2447,9 +2447,10 @@
       if (common_curves.size() >= 1)
         sort_successful = sort_curves(common_curves, temp_edge_lists);
 
-      if ( common_curves.size() > 2 && 
+      if ( common_curves.size() >= 2 && 
            (type == CONE_SURFACE_TYPE || type == SPHERE_SURFACE_TYPE ||
-            type == TORUS_SURFACE_TYPE ||type == UNDEFINED_SURFACE_TYPE))
+            type == TORUS_SURFACE_TYPE ||type == UNDEFINED_SURFACE_TYPE ||
+            type == SPLINE_SURFACE_TYPE))
       {
         //if the two shapes has common volume, do boolean operations
         BRepAlgoAPI_Common intersector(*from_shape, *tool_shape);
@@ -2815,8 +2816,10 @@
                   {
                     //use the myWire to create a surface and webcut the 
                     //periodic body.
-                    Surface *wire_surf = make_Surface(PLANE_SURFACE_TYPE,
+                    Surface *wire_surf = make_Surface(BEST_FIT_SURFACE_TYPE,
                        wire_curves);
+                    if(wire_surf == NULL)
+                      wire_surf = make_Surface(PLANE_SURFACE_TYPE, wire_curves);
                     if(wire_surf)
                     {
                       OCCSurface* occ_wire_s = CAST_TO(wire_surf, OCCSurface);
@@ -3574,7 +3577,13 @@
        {
          BodySM* newBody = NULL;
          BodySM* oldBody = from_body_list[i];
-         do{
+         TopExp_Explorer Ex;
+         Ex.Init(*shape1, TopAbs_SOLID);
+         int nSolid = 0;
+         for(; Ex.More(); Ex.Next())
+           nSolid++;
+         do
+         { 
            TopoDS_Face* face = face_list.pop();
            int k = OCCQueryEngine::instance()->OCCMap->Find(*face);
            OCCSurface* cut_face = (OCCSurface*)(OCCQueryEngine::instance()->OccToCGM->find(k))->second;
@@ -3592,6 +3601,10 @@
              shape1 = shapes.get();
              shape_list[i] = shape1;
            }
+           if(nSolid == 1)
+             break;
+           else


More information about the cgma-dev mailing list