44#include "MeshRepairPlugin.hh"
52 unsigned int count(0);
61 MeshSelection::clearVertexSelection(mesh);
63 TriMesh::VVIter vv_it;
64 TriMesh::VFIter vf_it;
68 for (
auto v_it : mesh->vertices())
70 if (!mesh->status(v_it).deleted() && !v_it.is_boundary() && v_it.valence() == 3)
72 vf_it = mesh->vf_iter(v_it);
77 if ( (n0|n1) > cosangle &&
82 mesh->status(v_it).set_selected(
true);
89 emit log(
LOGERR,
"Cannot detect flat triangles on non-trimesh " + QString::number(_objectId) +
".");
97 emit log (
LOGINFO,
"Selected " + QString::number(count) +
" vertices on object " + QString::number(_objectId) +
" with face angle difference smaller than " + QString::number(_angle) +
".");
98 emit scriptInfo(
"detectFlatValence3Vertices(" + QString::number(_objectId) +
", " + QString::number(_angle) +
")" );
106 unsigned int count = 0;
114 std::vector<TriMesh::VertexHandle> vh(3);
116 for(
auto v_it : mesh->vertices()) {
117 if ((mesh->status(v_it).selected()) && !mesh->status(v_it).feature() && v_it.valence() == 3) {
119 for (
auto vv_it : v_it.vertices()) {
124 mesh->delete_vertex(v_it,
false);
131 mesh->garbage_collection();
136 emit createBackup(_objectId,
"Delete/merge selected vertices",
UPDATE_ALL);
138 emit log(
"Deleted " + QString::number(count) +
" vertices on object " + QString::number(_objectId) +
".");
Functions for selection on a mesh.
void removeSelectedVal3Vertices(int _objectId)
Remove all selected valence 3 vertices.
void detectFlatValence3Vertices(int _objectId, double _angle)
Detect valence 3 vertices with faces that lie in the plane of their adjacent triangles.
Kernel::Scalar Scalar
Scalar type.
Kernel::Normal Normal
Normal type.
Kernel::FaceHandle FaceHandle
Scalar type.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(16))
Selection updated.
bool getMesh(int _identifier, PolyMesh *&_mesh)
Get the Poly Mesh which has the given identifier.