Merge pull request #7161 from afabri/Polyhedron_demo-clamp-GF

3D Demo: Fix statistics on angles
This commit is contained in:
Laurent Rineau 2023-01-27 21:02:09 +01:00
commit 65103a9c70
1 changed files with 2 additions and 8 deletions

View File

@ -50,7 +50,6 @@ void compute_angles(Mesh* poly,Tester tester , double& mini, double& maxi, doubl
typedef typename boost::graph_traits<Mesh>::face_descriptor face_descriptor;
typedef typename boost::property_map<Mesh, CGAL::vertex_point_t>::type VPMap;
typedef typename CGAL::Kernel_traits< typename boost::property_traits<VPMap>::value_type >::Kernel Traits;
double rad_to_deg = 180. / CGAL_PI;
accumulator_set< double,
features< tag::min, tag::max, tag::mean > > acc;
@ -67,12 +66,8 @@ void compute_angles(Mesh* poly,Tester tester , double& mini, double& maxi, doubl
typename Traits::Point_3 b = get(vpmap, target(h, *poly));
typename Traits::Point_3 c = get(vpmap, target(next(h, *poly), *poly));
typename Traits::Vector_3 ba(b, a);
typename Traits::Vector_3 bc(b, c);
double cos_angle = (ba * bc)
/ std::sqrt(ba.squared_length() * bc.squared_length());
acc(std::acos(cos_angle) * rad_to_deg);
typename Traits::FT ang = CGAL::approximate_angle(b,a,c);
acc(CGAL::to_double(ang));
}
mini = extract_result< tag::min >(acc);
@ -281,4 +276,3 @@ void faces_aspect_ratio(Mesh* poly,
faces_aspect_ratio(poly, faces(*poly), min_altitude, mini, maxi, mean);
}
#endif // POLYHEDRON_DEMO_STATISTICS_HELPERS_H