166 std::vector<Vec<2>> vertices;
167 boost::tokenizer<boost::char_separator<char>>
tokens(
vertex_spec, boost::char_separator<char>(
" \t\n\r",
";"));
169 for (
const std::string& t :
tokens) {
171 if (
vi != 2)
throw Exception(
"each vertex must have two coordinates");
175 throw Exception(
"end of vertex (\";\") was expected, but got \"{0}\"", t);
176 if (
vi == 0) vertices.emplace_back();
178 vertices.back()[
vi++] = boost::lexical_cast<double>(t);
179 }
catch (
const boost::bad_lexical_cast&) {
180 throw Exception(
"bad vertex coordinate: {0}", t);
184 polygon->vertices = std::move(vertices);