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

janehu at mcs.anl.gov janehu at mcs.anl.gov
Thu Jan 8 13:30:03 CST 2009


Author: janehu
Date: 2009-01-08 13:30:03 -0600 (Thu, 08 Jan 2009)
New Revision: 2520

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
Finish the get_conic_mid_surface function.

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-01-08 19:23:55 UTC (rev 2519)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-01-08 19:30:03 UTC (rev 2520)
@@ -5445,6 +5445,10 @@
 
   CubitBox bounding_box = GeometryQueryTool::instance()->model_bounding_box();
   double height = (bounding_box.diagonal()).length();
+  OCCBody* body = CAST_TO(body_to_trim_to, OCCBody);
+  CubitVector centroid;
+  double volume;
+  body->mass_properties(centroid, volume);
   BodySM* tool;
   if(type1 == GeomAbs_Cylinder)
   {
@@ -5473,6 +5477,10 @@
     }
 
     tool = CAST_TO(lump, OCCLump)->get_body();
+    double z = centroid.z();
+    z -= height/2.0;
+    centroid.z(z);
+    OCCQueryEngine::instance()->translate(tool, centroid);  
   }
 
   else  //GeomAbs_Cone
@@ -5499,9 +5507,13 @@
       return CUBIT_FAILURE;
     }
     double r1 = cone1.RefRadius()/2.0 + cone2.RefRadius()/2.0; 
-    gp_Pnt apex1 = cone1.Apex();
-    gp_Pnt apex2 = cone2.Apex();
-    double d = apex1.Distance(apex2);
+    gp_Ax3 axis;
+    axis.SetAxis(axis1);
+    gp_Cone cone(axis, angle1, r1);
+    TopoDS_Face face = BRepBuilderAPI_MakeFace(cone);
+    Surface* surface = 
+      OCCQueryEngine::instance()->populate_topology_bridge(face, CUBIT_TRUE);
+    tool = CAST_TO(surface,OCCSurface)->my_body();  
   } 
   DLIList<BodySM*> from_bodies;
   from_bodies.append(body_to_trim_to);




More information about the cgma-dev mailing list