From 2a679483b2c1af4bb855bd13c2aa82ac93906ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 16 Oct 2022 16:22:29 +0200 Subject: [PATCH] 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. --- Weights/include/CGAL/Weights/tangent_weights.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Weights/include/CGAL/Weights/tangent_weights.h b/Weights/include/CGAL/Weights/tangent_weights.h index 03c8e91ad5b..da4c87d0fdd 100644 --- a/Weights/include/CGAL/Weights/tangent_weights.h +++ b/Weights/include/CGAL/Weights/tangent_weights.h @@ -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);