Remove degenerate faces

customizer
Marius Kintel 2013-12-25 18:57:11 -05:00
parent e27c05cf0e
commit 5d29804882
1 changed files with 16 additions and 8 deletions

View File

@ -294,16 +294,24 @@ public:
B.add_vertex(CGALPoint(v[0], v[1], v[2]));
}
}
B.begin_facet();
printf("[");
int fidx = 0;
std::map<size_t,int> fc;
bool facet_is_degenerate = false;
BOOST_REVERSE_FOREACH(size_t i, indices) {
B.add_vertex_to_facet(i);
if (fidx++ > 0) printf(",");
printf("%ld", i);
if (fc[i]++ > 0) facet_is_degenerate = true;
}
if (!facet_is_degenerate) {
B.begin_facet();
printf("[");
int fidx = 0;
std::map<int,int> fc;
BOOST_REVERSE_FOREACH(size_t i, indices) {
B.add_vertex_to_facet(i);
if (fidx++ > 0) printf(",");
printf("%ld", i);
}
printf("]");
B.end_facet();
}
printf("]");
B.end_facet();
}
B.end_surface();
printf("],\n");