13 #include <boost/graph/graph_traits.hpp>
14 #include <boost/graph/properties.hpp>
15 #include <CGAL/boost/graph/iterator.h>
47 template<
typename FaceGraph,
50 typename boost::property_traits< PointMap >::value_type
55 const typename GeometryTraits::Scalar smoothing_factor,
56 const GeometryTraits >)
67 Vector vec = gt.NULL_VECTOR;
68 double sum_iangles = 0.0f, alpha1, alpha2, iangle;
70 CGAL::Halfedge_around_target_circulator< FaceGraph > cir_he(v, g),
76 alpha1 = FEVV::Operators::Geometry::triangle_rad_angle< GeometryTraits >(
84 alpha2 = FEVV::Operators::Geometry::triangle_rad_angle< GeometryTraits >(
93 if(alpha1 < 0.0 || alpha2 < 0.0)
101 d1 = gt.normalize(d1);
104 d2 = gt.normalize(d2);
108 is_geometrical_fold< FaceGraph, PointMap, GeometryTraits >(
119 c = c * (1.0 / std::sqrt(gt.dot_product(c, c)));
120 Point new_ideal_point = gt.add_pv(
122 c * std::sqrt(gt.dot_product(gt.sub_p(
get(pm,
target(*cir_he, g)),
129 iangle = alpha1 + alpha2;
130 iangle = 1.0 / (iangle * iangle);
131 dc = gt.sub_p(new_ideal_point,
get(pm, v));
136 vec = vec + dc * iangle;
137 sum_iangles += iangle;
139 }
while(++cir_he != cir_he_end);
141 vec = vec * (1.0 / sum_iangles);
147 N = (pVertex->closestObs())->normal();
153 n = FEVV::Operators::
154 calculate_vertex_normal< FaceGraph, PointMap, GeometryTraits >(
157 vec = vec - gt.dot_product(vec, n) * n;
160 return gt.add_pv(
get(pm, v), smoothing_factor * vec);