-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
OFF | ||
5 4 0 | ||
|
||
0.60153250345565623 3.2925554343503594 -0.93390733763467004 | ||
0.50125687092531912 3.266008536541555 -0.80580753798383942 | ||
0.57499779785916183 3.2558452065056969 -0.97860403852322797 | ||
0.56586410588624558 3.2541065339825863 -0.99341202997519495 | ||
0.56756366821062887 3.2478315549358072 -0.99100621040927039 | ||
|
||
3 0 1 2 | ||
3 1 3 2 | ||
3 1 0 3 | ||
3 0 4 3 | ||
|
||
|
||
|
44 changes: 44 additions & 0 deletions
44
Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <CGAL/Simple_cartesian.h> | ||
#include <CGAL/Surface_mesh.h> | ||
#include <CGAL/Surface_mesh_simplification/edge_collapse.h> | ||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h> | ||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h> | ||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h> | ||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h> | ||
|
||
#include <cstdlib> | ||
#include <iostream> | ||
#include <fstream> | ||
|
||
namespace SMS = CGAL::Surface_mesh_simplification; | ||
|
||
typedef CGAL::Simple_cartesian<double> Kernel; | ||
typedef CGAL::Surface_mesh<Kernel::Point_3> Surface_mesh; | ||
|
||
int main() { | ||
|
||
std::string filename("data/issue_8213.off"); | ||
|
||
Surface_mesh surface_mesh; | ||
|
||
std::ifstream in(filename); | ||
in >> surface_mesh; | ||
|
||
const size_t target_number_of_faces = 3; | ||
SMS::Face_count_stop_predicate<Surface_mesh> stop(target_number_of_faces); | ||
|
||
std::cout << "Input mesh number of faces: " << surface_mesh.number_of_faces() << ", target number of faces: " << target_number_of_faces << std::endl; | ||
|
||
SMS::edge_collapse( | ||
surface_mesh, | ||
stop, | ||
CGAL::parameters:: | ||
filter(SMS::Bounded_normal_change_filter<>()) | ||
.get_cost(SMS::LindstromTurk_cost<Surface_mesh>()) | ||
.get_placement(SMS::LindstromTurk_placement<Surface_mesh>()) | ||
); | ||
|
||
std::cout.precision(17); | ||
std::cout << surface_mesh << std::endl; | ||
return EXIT_SUCCESS; | ||
} |