mirror of https://github.com/CGAL/cgal
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:
parent
2fe82ec9d9
commit
2a679483b2
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue