From e2bac3fbdf32547b9826afeca63e4f5545a19164 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 6 Dec 2013 14:40:41 +0000 Subject: [PATCH] 52233: TC7.3.0: unexpected mesh computation failed Split all quadrangles into triangles as quadrangles are no longer acceptable as input --- src/HexoticPlugin/HexoticPlugin_Hexotic.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx index 1c1bfa0..9db08d4 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -369,6 +369,23 @@ static void removeHexoticFiles(TCollection_AsciiString file_In, TCollection_Asci removeFile( file_Out ); } +//======================================================================= +//function : splitQuads +//purpose : splits all quadrangles into triangles +//======================================================================= + +static void splitQuads(SMESH_Mesh& aMesh) +{ + SMESH_MeshEditor spliter( &aMesh ); + + TIDSortedElemSet elems; + SMDS_ElemIteratorPtr eIt = aMesh.GetMeshDS()->elementsIterator(); + while( eIt->more() ) + elems.insert( elems.end(), eIt->next() ); + + spliter.QuadToTri ( elems, /*the13Diag=*/true); +} + //======================================================================= //function : readResult //purpose : Read GMF file in case of a mesh with geometry @@ -1496,6 +1513,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, #endif Hexotic_In = aTmpDir + "Hexotic"+getSuffix()+"_In.mesh"; removeHexoticFiles(Hexotic_In, Hexotic_Out); + splitQuads(aMesh); // quadrangles are no longer acceptable as input cout << std::endl; cout << "Creating Hexotic input mesh file : " << Hexotic_In << std::endl; aMesh.ExportGMF(Hexotic_In.ToCString(), meshDS, true); @@ -1651,6 +1669,8 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel removeHexoticFiles(Hexotic_In, Hexotic_Out); + splitQuads(aMesh); // quadrangles are no longer acceptable as input + cout << std::endl; cout << "Creating Hexotic input mesh file : " << Hexotic_In << std::endl; aMesh.ExportGMF(Hexotic_In.ToCString(), aHelper->GetMeshDS()); -- 2.39.2