diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e7de5d4d1871f9831747263f6fe7e27ed3bfe7d..86c212e330bb8d5c80e7298a58d8d8a7192e923d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ v5.0.0 expansion in pyramids (!750) - Significant overhaul of CMake infrastructure (!770, !804) - Fix ThridpartyCCM options (!802) +- Fix Windows CRLF tokens in GEO reader and improve comment handling (!805) **NekMesh**: - Add feature to read basic 2D geo files as CAD (!731) diff --git a/library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp b/library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp index 5b9e075bb1002d8dd468fb216024575653890219..d1180b62743e4cbaebf0d15dc9821e0922b4d6a4 100644 --- a/library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp +++ b/library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp @@ -57,9 +57,9 @@ bool CADSystemOCE::LoadCAD() { if (m_naca.size() == 0) { - //not a naca profile behave normally - //could be a geo - string ext = boost::filesystem::extension(m_name); + // not a naca profile behave normally + // could be a geo + string ext = boost::filesystem::extension(m_name); if (boost::iequals(ext, ".geo")) { @@ -422,15 +422,11 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) { getline(f, fline); - if (fline.size() == 0) - { - continue; - } + boost::erase_all(fline, "\r"); - if (boost::starts_with(fline, "//")) - { - continue; - } + vector tmp1, tmp2; + boost::split(tmp1, fline, boost::is_any_of("//")); + fline = tmp1[0]; if (!boost::contains(fline, ";")) { @@ -441,7 +437,6 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) fline = flinetmp + fline; flinetmp.clear(); - vector tmp1, tmp2; boost::split(tmp1, fline, boost::is_any_of("=")); boost::split(tmp2, tmp1[0], boost::is_any_of("(")); @@ -472,9 +467,9 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) } else if (boost::iequals(type, "Line Loop")) { - //line loops sometimes have negative entries for gmsh - //orientaton purposes - //we dont care so remove it + // line loops sometimes have negative entries for gmsh + // orientaton purposes + // we dont care so remove it boost::erase_all(var, "-"); loops[id] = var; } @@ -561,6 +556,5 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) return sf.Face(); } - } }