mirror of https://github.com/vitalif/openscad
Remove degenerate faces
parent
e27c05cf0e
commit
5d29804882
|
@ -294,9 +294,16 @@ public:
|
|||
B.add_vertex(CGALPoint(v[0], v[1], v[2]));
|
||||
}
|
||||
}
|
||||
std::map<size_t,int> fc;
|
||||
bool facet_is_degenerate = false;
|
||||
BOOST_REVERSE_FOREACH(size_t i, indices) {
|
||||
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(",");
|
||||
|
@ -305,6 +312,7 @@ public:
|
|||
printf("]");
|
||||
B.end_facet();
|
||||
}
|
||||
}
|
||||
B.end_surface();
|
||||
printf("],\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue