46 #include "MeshRepairPlugin.hh" 61 unsigned int count(0);
64 MeshSelection::clearFaceSelection(mesh);
66 TriMesh::FaceIter f_it, f_end(mesh->faces_end());
67 TriMesh::FVIter fv_it;
68 TriMesh::FEIter fe_it;
70 for (f_it = mesh->faces_begin(); f_it != f_end; ++f_it) {
71 fv_it = mesh->fv_iter(*f_it);
78 mesh->status(*f_it).set_selected(
true);
85 emit scriptInfo(
"detectTriangleAspect(" + QString::number(_objectId) +
", " + QString::number(_aspect) +
")" );
88 "Selected " + QString::number(count) +
" triangles on object " + QString::number(_objectId)
89 +
" with aspect ratio greater than " + QString::number(_aspect) +
".");
91 emit log(
"Cannot detect skinny triangles on non-trimesh " + QString::number(_objectId) +
".");
112 emit log(
LOGERR,tr(
"Unsupported Object Type for normal flipping!") );
116 emit createBackup( _objectId,
"Flipped Normals",
UPDATE_ALL);
117 emit scriptInfo(
"flipOrientation(" + QString::number(_objectId) +
")" );
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
Kernel::Point Point
Coordinate type.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(1)<< 4)
Selection updated.
Scalar aspectRatio(const VectorT< Scalar, N > &_v0, const VectorT< Scalar, N > &_v1, const VectorT< Scalar, N > &_v2)
return aspect ratio (length/height) of triangle
bool getMesh(int _identifier, PolyMesh *&_mesh)
Get the Poly Mesh which has the given identifier.
Functions for selection on a mesh.
void flipOrientation(int _objectId)
Flips the normals of all selected faces by changing the vertex order.
void detectTriangleAspect(int _objectId, float _aspect)
Detect triangles with aspect ratio greater than _aspect and select them.