This commit is contained in:
Mael 2025-07-17 11:37:58 +02:00 committed by GitHub
parent 4018082784
commit 13f5968eaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 25 deletions

View File

@ -11,6 +11,3 @@ OFF
3 1 3 2
3 1 0 3
3 0 4 3

View File

@ -3,8 +3,6 @@
#include <CGAL/Surface_mesh.h>
CGAL::Bbox_3 bbox_g;
double max_bbox_g;
#define CGAL_CHECK_EXPENSIVE
#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5
@ -17,7 +15,6 @@ void Surface_simplification_external_trace(const std::string& s)
#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/Bounding_box_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>
@ -50,19 +47,14 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}
auto bb=PMP::bbox(sm);
CGAL::Bbox_3 bb = PMP::bbox(sm);
std::cout << "Bbox:" << bb << std::endl;
std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl;
std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl;
SMS::Face_count_stop_predicate<Surface_mesh> stop(1);
SMS::edge_collapse(
sm,
stop,
CGAL::parameters::
// filter(SMS::Bounded_normal_change_filter<>()) //<SMS::Bounding_box_filter<>>(SMS::Bounding_box_filter<>()))
get_cost(SMS::LindstromTurk_cost<Surface_mesh>())
SMS::edge_collapse(sm, stop,
CGAL::parameters::get_cost(SMS::LindstromTurk_cost<Surface_mesh>())
.get_placement(SMS::LindstromTurk_placement<Surface_mesh>())
);
CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17));