[cgma-dev] r5383 - cgm/trunk/geom/OCC
jiangtao_ma at yahoo.com
jiangtao_ma at yahoo.com
Thu Feb 9 10:23:13 CST 2012
Author: janehu
Date: 2012-02-09 10:23:10 -0600 (Thu, 09 Feb 2012)
New Revision: 5383
Modified:
cgm/trunk/geom/OCC/OCCModifyEngine.cpp
cgm/trunk/geom/OCC/OCCModifyEngine.hpp
Log:
Fixed the problem of making skin surface gives wrong results reported by Boyd Tidwell. Testcase is in trunk/test/loft.cpp.
Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2012-02-08 19:34:10 UTC (rev 5382)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2012-02-09 16:23:10 UTC (rev 5383)
@@ -842,9 +842,43 @@
}
CubitStatus stat = sort_curves(curve_list, topo_edges_loops);
- if( stat == CUBIT_FAILURE ) //case of one disconnected curve
- return (Surface*) NULL;
+ if( stat == CUBIT_FAILURE ) //case of one disconnected curve , open wires
+ {
+ //loft curves.
+ BRepOffsetAPI_ThruSections loft(CUBIT_FALSE);
+ CubitStatus stat = do_loft(loft, topo_edges_loops);
+ if(!stat)
+ return (Surface*) NULL;
+
+ TopoDS_Shape shape = loft.Shape();
+ TopoDS_Shell shell = TopoDS::Shell(shape);
+ TopExp_Explorer Ex;
+ int num_surfaces = 0;
+ TopoDS_Face topo_face ;
+ for (Ex.Init(shell, TopAbs_FACE); Ex.More(); Ex.Next())
+ {
+ topo_face = TopoDS::Face(Ex.Current());
+ num_surfaces ++;
+ }
+
+ if(num_surfaces != 1)
+ {
+ PRINT_ERROR("In OCCModifyEngine::skin_surface\n"
+ " Cannot create a skin surface for given curves.\n");
+ return (Surface*) NULL;
+ }
+
+ Surface* surf = OCCQueryEngine::instance()->populate_topology_bridge(topo_face, CUBIT_TRUE);
+ if (surf == NULL)
+ {
+ PRINT_ERROR("In OCCModifyEngine::skin_surfaces\n"
+ " Cannot create a skin surface for given curves.\n");
+ return (Surface*) NULL;
+ }
+ return surf;
+ }
+
// Use the topo_edges to make a topo_face
TopoDS_Face* topo_face;
topo_face = make_TopoDS_Face(surface_type,topo_edges_loops, old_surface_ptr);
@@ -888,6 +922,36 @@
More information about the cgma-dev
mailing list