mirror of https://github.com/CGAL/cgal
Call approximate_dihedral_angle() from the Kernel
This commit is contained in:
parent
6be3772654
commit
39c27cb9db
|
|
@ -13,7 +13,6 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <CGAL/gl.h>
|
#include <CGAL/gl.h>
|
||||||
#include <CGAL/Mesh_3/dihedral_angle_3.h>
|
|
||||||
#include <CGAL/Three/Scene_interface.h>
|
#include <CGAL/Three/Scene_interface.h>
|
||||||
#include <CGAL/Real_timer.h>
|
#include <CGAL/Real_timer.h>
|
||||||
|
|
||||||
|
|
@ -562,32 +561,32 @@ create_histogram(const C3t3& c3t3, double& min_value, double& max_value)
|
||||||
const Point_3& p2 = cit->vertex(2)->point();
|
const Point_3& p2 = cit->vertex(2)->point();
|
||||||
const Point_3& p3 = cit->vertex(3)->point();
|
const Point_3& p3 = cit->vertex(3)->point();
|
||||||
|
|
||||||
double a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p0, p1, p2, p3)));
|
double a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p0, p1, p2, p3)));
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p0, p2, p1, p3)));
|
a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p0, p2, p1, p3)));
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p0, p3, p1, p2)));
|
a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p0, p3, p1, p2)));
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p1, p2, p0, p3)));
|
a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p1, p2, p0, p3)));
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p1, p3, p0, p2)));
|
a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p1, p3, p0, p2)));
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
||||||
a = CGAL::to_double(CGAL::abs(CGAL::Mesh_3::dihedral_angle(p2, p3, p0, p1)));
|
a = CGAL::to_double(CGAL::abs(CGAL::approximate_dihedral_angle(p2, p3, p0, p1)));
|
||||||
histo[static_cast<int>(std::floor(a))] += 1;
|
histo[static_cast<int>(std::floor(a))] += 1;
|
||||||
min_value = (std::min)(min_value, a);
|
min_value = (std::min)(min_value, a);
|
||||||
max_value = (std::max)(max_value, a);
|
max_value = (std::max)(max_value, a);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||||
|
|
@ -13,7 +11,6 @@
|
||||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h>
|
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h>
|
||||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
|
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
|
||||||
#include <CGAL/Unique_hash_map.h>
|
#include <CGAL/Unique_hash_map.h>
|
||||||
#include <CGAL/Mesh_3/dihedral_angle_3.h>
|
|
||||||
#include <CGAL/property_map.h>
|
#include <CGAL/property_map.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
|
@ -106,10 +103,10 @@ int main( int argc, char** argv )
|
||||||
point(target(hd,surface_mesh),surface_mesh));
|
point(target(hd,surface_mesh),surface_mesh));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
double angle = CGAL::Mesh_3::dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh),
|
double angle = CGAL::approximate_dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh),
|
||||||
point(target(hd,surface_mesh),surface_mesh),
|
point(target(hd,surface_mesh),surface_mesh),
|
||||||
point(target(next(hd,surface_mesh),surface_mesh),surface_mesh),
|
point(target(next(hd,surface_mesh),surface_mesh),surface_mesh),
|
||||||
point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh));
|
point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh));
|
||||||
if ( CGAL::abs(angle)<100 ){
|
if ( CGAL::abs(angle)<100 ){
|
||||||
++nb_sharp_edges;
|
++nb_sharp_edges;
|
||||||
constraint_hmap[*eb]=true;
|
constraint_hmap[*eb]=true;
|
||||||
|
|
@ -152,10 +149,10 @@ int main( int argc, char** argv )
|
||||||
point(target(hd,surface_mesh),surface_mesh)));
|
point(target(hd,surface_mesh),surface_mesh)));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
double angle = CGAL::Mesh_3::dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh),
|
double angle = approximate_dihedral_angle(point(target(opposite(hd,surface_mesh),surface_mesh),surface_mesh),
|
||||||
point(target(hd,surface_mesh),surface_mesh),
|
point(target(hd,surface_mesh),surface_mesh),
|
||||||
point(target(next(hd,surface_mesh),surface_mesh),surface_mesh),
|
point(target(next(hd,surface_mesh),surface_mesh),surface_mesh),
|
||||||
point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh));
|
point(target(next(opposite(hd,surface_mesh),surface_mesh),surface_mesh),surface_mesh));
|
||||||
if ( CGAL::abs(angle)<100 ){
|
if ( CGAL::abs(angle)<100 ){
|
||||||
--nb_sharp_edges;
|
--nb_sharp_edges;
|
||||||
assert(
|
assert(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue