46#include "MeshRepairPlugin.hh"
61 unsigned int count(0);
64 MeshSelection::clearFaceSelection(mesh);
66 TriMesh::FVIter fv_it;
67 TriMesh::FEIter fe_it;
69 for (
auto f_it : mesh->faces()) {
70 fv_it = mesh->fv_iter(f_it);
77 mesh->status(f_it).set_selected(
true);
84 emit scriptInfo(
"detectTriangleAspect(" + QString::number(_objectId) +
", " + QString::number(_aspect) +
")" );
87 "Selected " + QString::number(count) +
" triangles on object " + QString::number(_objectId)
88 +
" with aspect ratio greater than " + QString::number(_aspect) +
".");
90 emit log(
"Cannot detect skinny triangles on non-trimesh " + QString::number(_objectId) +
".");
111 emit log(
LOGERR,tr(
"Unsupported Object Type for normal flipping!") );
115 emit createBackup( _objectId,
"Flipped Normals",
UPDATE_ALL);
116 emit scriptInfo(
"flipOrientation(" + QString::number(_objectId) +
")" );
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.
Kernel::Point Point
Coordinate type.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(16))
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.