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

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Fri Mar 6 13:08:41 CST 2009


Author: janehu
Date: 2009-03-06 13:08:39 -0600 (Fri, 06 Mar 2009)
New Revision: 2689

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
Added create_offset_intersection funtion for curve surface intersection.

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-03-06 18:26:16 UTC (rev 2688)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-03-06 19:08:39 UTC (rev 2689)
@@ -5542,7 +5542,9 @@
                                               double offset,
                                               CubitBoolean ext_first ) 
 {
-  
+  //offset the curve1 in both directions of normal direction of two curves at
+  //center points.
+    
   return CUBIT_SUCCESS;
 }
 
@@ -5559,8 +5561,41 @@
                                            double offset,
                                            CubitBoolean ext_surf )
 {
+  Surface* new_surface = face_ptr;
+  if(ext_surf)
+    new_surface = make_Surface(face_ptr, CUBIT_TRUE);
+
+  BodySM* bodysm = NULL;
+  CubitStatus status = CUBIT_SUCCESS;
+  status = create_offset_surface(new_surface, bodysm, offset); 
+  if(status == CUBIT_FAILURE)
+  {
+    PRINT_ERROR("Can't offset surface. \n");
+    return status;
+  }
+  OCCSurface* surface = CAST_TO(bodysm, OCCBody)->my_sheet_surface();
+
+  status = OCCQueryEngine::instance()->get_intersections(curve1, surface, out_list);
   
-  return CUBIT_SUCCESS;
+  if(ext_surf || offset)
+    OCCQueryEngine::instance()->delete_solid_model_entities(surface);
+ 
+  //offset surface in opposite direction
+  if(!offset)
+    return status;
+
+  status = create_offset_surface(new_surface, bodysm, -offset);
+  if(status == CUBIT_FAILURE)
+  {
+    PRINT_ERROR("Can't offset surface. \n");
+    return status;
+  }
+  surface = CAST_TO(bodysm, OCCBody)->my_sheet_surface();
+  status = OCCQueryEngine::instance()->get_intersections(curve1, surface, out_list);
+  OCCQueryEngine::instance()->delete_solid_model_entities(surface);
+  if(ext_surf)
+    OCCQueryEngine::instance()->delete_solid_model_entities(new_surface);
+  return status;
 }
 
 //===============================================================================



More information about the cgma-dev mailing list