Remove newlines and other characters from material names

This commit is contained in:
Thomas Krijnen
2019-10-29 10:06:02 +01:00
parent 0a610f88e0
commit f231db0aff
@@ -65,7 +65,9 @@ namespace IfcGeom {
std::stringstream sstr;
std::string sanitized = name;
boost::to_lower(sanitized);
boost::replace_all(sanitized, " ", "-");
std::replace_if(sanitized.begin(), sanitized.end(), [](char c) {
return c < 0x21 || c > 0x7e;
}, '-');
sstr << "surface-style-" << id << "-" << sanitized;
this->name = sstr.str();
}