[cgma-dev] r5376 - cgm/trunk/geom/OCC
jiangtao_ma at yahoo.com
jiangtao_ma at yahoo.com
Fri Feb 3 11:22:28 CST 2012
Author: janehu
Date: 2012-02-03 11:22:24 -0600 (Fri, 03 Feb 2012)
New Revision: 5376
Modified:
cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
Fixed the loft problem reported by Boyd Tidwell. Created and passed test in cgm/test.
Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2012-02-02 23:44:10 UTC (rev 5375)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2012-02-03 17:22:24 UTC (rev 5376)
@@ -9279,7 +9279,7 @@
TopoDS_Shape shape = loft.Shape();
TopoDS_Solid solid = TopoDS::Solid(shape);
- Lump* lump = OCCQueryEngine::instance()->populate_topology_bridge(solid);
+ Lump* lump = OCCQueryEngine::instance()->populate_topology_bridge(solid, CUBIT_TRUE);
if (lump == NULL)
{
PRINT_ERROR("In OCCModifyEngine::loft_surfaces_to_body\n"
@@ -9301,18 +9301,31 @@
PRINT_ERROR("Surfaces are not OCC type.\n");
return CUBIT_FAILURE;
}
+
TopoDS_Face* topo_face1 = surf1->get_TopoDS_Face();
TopoDS_Face* topo_face2 = surf2->get_TopoDS_Face();
+
+ TopoDS_Face new_face1, new_face2;
+ BRepBuilderAPI_Copy api_copy(*topo_face1);
+ TopoDS_Shape newShape = api_copy.ModifiedShape(*topo_face1);
+ new_face1 = TopoDS::Face(newShape);
+
+ BRepBuilderAPI_Copy api_copy2(*topo_face2);
+ newShape = api_copy2.ModifiedShape(*topo_face2);
+ new_face2 = TopoDS::Face(newShape);
+
TopExp_Explorer Ex;
- Ex.Init(*topo_face1, TopAbs_WIRE);
+ Ex.Init(new_face1, TopAbs_WIRE);
TopoDS_Wire wire1 = TopoDS::Wire(Ex.Current());
+ Ex.Next();
if(Ex.More())
{
PRINT_ERROR("Surface1 must have only one loop.\n");
return CUBIT_FAILURE;
}
- Ex.Init(*topo_face2, TopAbs_WIRE);
+ Ex.Init(new_face2, TopAbs_WIRE);
TopoDS_Wire wire2 = TopoDS::Wire(Ex.Current());
+ Ex.Next();
if(Ex.More())
{
PRINT_ERROR("Surface2 must have only one loop.\n");
More information about the cgma-dev
mailing list