Fix ARAP post processing

The formula of weights is "- tan(theta / 2) / length", with:
 tan ( theta / 2 ) = sin ( theta ) / ( 1 + cos ( theta ) )
                   = ( 2 * A / |v1| * |v2| ) / ( 1 + v1 . v2 / |v1| * |v2| )
		   = 2 * A / ( |v1| * |v2| + v1 . v2 )

with A the _unsigned_ area.
This commit is contained in:
Mael Rouxel-Labbé 2022-10-16 16:22:29 +02:00
parent 2fe82ec9d9
commit 2a679483b2
1 changed files with 1 additions and 1 deletions

View File

@ -461,7 +461,7 @@ namespace Weights {
const auto v1 = construct_vector_2(q, r);
const auto v2 = construct_vector_2(q, p);
const auto A = internal::area_2(traits, p, q, r);
const auto A = internal::positive_area_2(traits, p, q, r);
CGAL_assertion(A != FT(0)); // three points are identical!
const auto S = scalar_product_2(v1, v2);
m_w_base = -tangent_half_angle(m_d_r, m_d_p, A, S);