Here is a snippet from "Polygon mesh process" example:
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) {
area = 0.0;
for (vf_it=mesh_.vf_iter(v_it); vf_it; ++vf_it)
{
fv_it = mesh_.fv_iter(vf_it);
const Mesh::Point& P = mesh_.point(fv_it); ++fv_it;
const Mesh::Point& Q = mesh_.point(fv_it); ++fv_it;
const Mesh::Point& R = mesh_.point(fv_it);
area += ((Q-P)%(R-P)).norm() * 0.5f * 0.3333f; // norm: compute euclidean norm, return Scalar
}
weight(v_it) = (fabs(area)>FLT_MIN ? 1.0 / (2.0 * area) : 0.0);
}
why 0.3333f is multiplied at the end?
The ((Q-P)%(R-P)).norm() * 0.5f
part, as you probably know, is simply the area of the triangle spanned by Q
, P
, and R
.
It appears that in this example a vertex weight proportional to the area of the surface assumed to "belong" to each vertex is computed. It is assumed that one third of the area of any incident triangle contributes to this particular vertex. (The other two thirds are considered to belong to the other two vertices incident to the respective triangle.) Hence your factor of (approximately) 1/3.