Commit e97a170a authored by Michael Turner's avatar Michael Turner

Merge branch 'fix/geo-spacing' into 'master'

Fix CR issue in the GEO reader

See merge request !805
parents 9a32dc04 24425e60
...@@ -8,6 +8,7 @@ v5.0.0 ...@@ -8,6 +8,7 @@ v5.0.0
expansion in pyramids (!750) expansion in pyramids (!750)
- Significant overhaul of CMake infrastructure (!770, !804) - Significant overhaul of CMake infrastructure (!770, !804)
- Fix ThridpartyCCM options (!802) - Fix ThridpartyCCM options (!802)
- Fix Windows CRLF tokens in GEO reader and improve comment handling (!805)
**NekMesh**: **NekMesh**:
- Add feature to read basic 2D geo files as CAD (!731) - Add feature to read basic 2D geo files as CAD (!731)
......
...@@ -57,9 +57,9 @@ bool CADSystemOCE::LoadCAD() ...@@ -57,9 +57,9 @@ bool CADSystemOCE::LoadCAD()
{ {
if (m_naca.size() == 0) if (m_naca.size() == 0)
{ {
//not a naca profile behave normally // not a naca profile behave normally
//could be a geo // could be a geo
string ext = boost::filesystem::extension(m_name); string ext = boost::filesystem::extension(m_name);
if (boost::iequals(ext, ".geo")) if (boost::iequals(ext, ".geo"))
{ {
...@@ -422,15 +422,11 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) ...@@ -422,15 +422,11 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo)
{ {
getline(f, fline); getline(f, fline);
if (fline.size() == 0) boost::erase_all(fline, "\r");
{
continue;
}
if (boost::starts_with(fline, "//")) vector<string> tmp1, tmp2;
{ boost::split(tmp1, fline, boost::is_any_of("//"));
continue; fline = tmp1[0];
}
if (!boost::contains(fline, ";")) if (!boost::contains(fline, ";"))
{ {
...@@ -441,7 +437,6 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) ...@@ -441,7 +437,6 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo)
fline = flinetmp + fline; fline = flinetmp + fline;
flinetmp.clear(); flinetmp.clear();
vector<string> tmp1, tmp2;
boost::split(tmp1, fline, boost::is_any_of("=")); boost::split(tmp1, fline, boost::is_any_of("="));
boost::split(tmp2, tmp1[0], boost::is_any_of("(")); boost::split(tmp2, tmp1[0], boost::is_any_of("("));
...@@ -472,9 +467,9 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) ...@@ -472,9 +467,9 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo)
} }
else if (boost::iequals(type, "Line Loop")) else if (boost::iequals(type, "Line Loop"))
{ {
//line loops sometimes have negative entries for gmsh // line loops sometimes have negative entries for gmsh
//orientaton purposes // orientaton purposes
//we dont care so remove it // we dont care so remove it
boost::erase_all(var, "-"); boost::erase_all(var, "-");
loops[id] = var; loops[id] = var;
} }
...@@ -561,6 +556,5 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo) ...@@ -561,6 +556,5 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo)
return sf.Face(); return sf.Face();
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment