16 lines
337 B
C++
16 lines
337 B
C++
#include "noise_removal.h"
|
|
#include "util.h"
|
|
|
|
|
|
void remove_noise(MyMesh &mesh, unsigned threshold) {
|
|
auto components = find_connected_components(mesh);
|
|
for (auto component : components) {
|
|
if (component.size() < threshold) {
|
|
for (VertexHandle vh : component) {
|
|
mesh.delete_vertex(vh);
|
|
}
|
|
}
|
|
}
|
|
mesh.garbage_collection();
|
|
}
|