Closed RasmusRPaulsen closed 4 years ago
TAL_smoothing was a terrible, terrible function. It used cotangent weights which is probably not a good idea since these weights are for smoothing geometry without smoothing the parametrisation (too much), but tangential area weighted laplacian smoothing is used to smooth the parametrisation while not changing the geometry too much. It also looked like the tangential part was missing ...
I have changed the function in the following way:
I am making some additions to GEL to make it possible to use range based for loops instead of circulation to get the neighbours of vertices and faces. This function will be part of the update coming later today.
Behaves very badly if there are overlapping vertices. It happens in normalize that assumes a non-zero distance between vertices.
Since this is an iterative smoothing process, overlapping vertices DO happen from time to time.
A solution is: { Vec3d vec_a = m.pos(w.vertex()) - m.pos(vid); Vec3d vec_b = m.pos(w.circulate_vertex_ccw().vertex()) - m.pos(vid); if (vec_a.length() && vec_b.length()) { vec_a = normalize(vec_a ); vec_b = normalize(vec_b); angle_sum += acos(max(-1.0, min(1.0, dot(vec_a, vec_b)))); } }