Rename algorithms and use data_file_path

This commit is contained in:
Julian Stahl 2022-09-15 18:09:26 +02:00
parent b10a086fe6
commit 5c1ad94140
12 changed files with 18 additions and 24 deletions

View File

@ -247,15 +247,13 @@ int main(int argc, char* argv[]) {
#if defined ALGO_MARCHING_CUBES #if defined ALGO_MARCHING_CUBES
std::cout << "ALGO_MARCHING_CUBES" << std::endl; std::cout << "ALGO_MARCHING_CUBES" << std::endl;
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes<Tag>(scenario.domain(), scenario.iso(), points, CGAL::Isosurfacing::marching_cubes<Tag>(scenario.domain(), scenario.iso(), points, polygons, false);
polygons);
#elif defined ALGO_DUAL_CONTOURING #elif defined ALGO_DUAL_CONTOURING
std::cout << "ALGO_DUAL_CONTOURING" << std::endl; std::cout << "ALGO_DUAL_CONTOURING" << std::endl;
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring<Tag>(scenario.domain(), scenario.iso(), points, polygons); CGAL::Isosurfacing::dual_contouring<Tag>(scenario.domain(), scenario.iso(), points, polygons);
#else #else
std::cout << "no algorithm selected!" << std::endl; std::cout << "no algorithm selected!" << std::endl;
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes<Tag>(scenario.domain(), scenario.iso(), points, CGAL::Isosurfacing::marching_cubes<Tag>(scenario.domain(), scenario.iso(), points, polygons);
polygons);
#endif #endif
const int64_t ms = timer.stop(); const int64_t ms = timer.stop();

View File

@ -3,7 +3,6 @@
#include <CGAL/Dual_contouring_3.h> #include <CGAL/Dual_contouring_3.h>
#include <CGAL/Marching_cubes_3.h> #include <CGAL/Marching_cubes_3.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/TC_marching_cubes_3.h>
#include <CGAL/boost/graph/IO/OFF.h> #include <CGAL/boost/graph/IO/OFF.h>
typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Simple_cartesian<double> Kernel;
@ -68,9 +67,8 @@ int main() {
Polygon_range polygons_mc, polygons_tmc, polygons_dc; Polygon_range polygons_mc, polygons_tmc, polygons_dc;
// execute marching cubes, topologically correct marching cubes and dual contouring with an isovalue of 0.8 // execute marching cubes, topologically correct marching cubes and dual contouring with an isovalue of 0.8
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 0.88, points_mc, polygons_mc); CGAL::Isosurfacing::marching_cubes(domain, 0.88, points_mc, polygons_mc);
CGAL::Isosurfacing::make_triangle_mesh_using_tmc(domain, 0.88, points_tmc, polygons_tmc); CGAL::Isosurfacing::dual_contouring(domain, 0.88, points_dc, polygons_dc);
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.88, points_dc, polygons_dc);
// save the results in the OFF format // save the results in the OFF format
CGAL::IO::write_OFF("result_mc.off", points_mc, polygons_mc); CGAL::IO::write_OFF("result_mc.off", points_mc, polygons_mc);

View File

@ -40,7 +40,7 @@ int main() {
Point_range points; Point_range points;
Polygon_range polygons; Polygon_range polygons;
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.8, points, polygons); CGAL::Isosurfacing::dual_contouring(domain, 0.8, points, polygons);
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);
} }

View File

@ -45,7 +45,7 @@ int main() {
Polygon_range polygons; Polygon_range polygons;
// execute marching cubes with an isovalue of 0 // execute marching cubes with an isovalue of 0
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.0f, points, polygons); CGAL::Isosurfacing::dual_contouring(domain, 0.0f, points, polygons);
// save the result in the OFF format // save the result in the OFF format
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);

View File

@ -25,7 +25,7 @@ typedef std::vector<Point> Point_range;
typedef std::vector<std::vector<std::size_t>> Polygon_range; typedef std::vector<std::vector<std::size_t>> Polygon_range;
int main() { int main() {
const std::string input_name = "../../../data/bunny.off"; const std::string input_name = CGAL::data_file_path("bunny.off");
const Vector grid_spacing(0.005, 0.005, 0.005); const Vector grid_spacing(0.005, 0.005, 0.005);
const FT offset_value = 0.01; const FT offset_value = 0.01;
@ -65,7 +65,7 @@ int main() {
Point_range points; Point_range points;
Polygon_range polygons; Polygon_range polygons;
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, offset_value, points, polygons); CGAL::Isosurfacing::dual_contouring(domain, offset_value, points, polygons);
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);
} }

View File

@ -87,7 +87,7 @@ int main() {
Point_range points; Point_range points;
Polygon_range polygons; Polygon_range polygons;
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(octree_domain, 0.8, points, polygons); CGAL::Isosurfacing::dual_contouring(octree_domain, 0.8, points, polygons);
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);
} }

View File

@ -41,7 +41,7 @@ int main() {
Polygon_range polygons; Polygon_range polygons;
// execute marching cubes with an isovalue of 0.8 // execute marching cubes with an isovalue of 0.8
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 0.8f, points, polygons); CGAL::Isosurfacing::marching_cubes(domain, 0.8f, points, polygons);
// save the result in the OFF format // save the result in the OFF format
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);

View File

@ -26,7 +26,7 @@ int main() {
Polygon_range polygons; Polygon_range polygons;
// execute marching cubes with an isovalue of 0.8 // execute marching cubes with an isovalue of 0.8
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 0.8f, points, polygons); CGAL::Isosurfacing::marching_cubes(domain, 0.8f, points, polygons);
// save the result in the OFF format // save the result in the OFF format
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);

View File

@ -14,7 +14,7 @@ typedef std::vector<std::vector<std::size_t>> Polygon_range;
int main() { int main() {
const std::string fname = "../../../data/skull_2.9.inr"; const std::string fname = CGAL::data_file_path("skull_2.9.inr"); // TODO: get other examples with rights
// load the image // load the image
CGAL::Image_3 image; CGAL::Image_3 image;
@ -34,7 +34,7 @@ int main() {
Polygon_range polygons; Polygon_range polygons;
// execute marching cubes with an isovalue of 2.9 // execute marching cubes with an isovalue of 2.9
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 2.9, points, polygons); CGAL::Isosurfacing::marching_cubes(domain, 2.9, points, polygons);
// save the result in the OFF format // save the result in the OFF format
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);

View File

@ -35,7 +35,7 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) {
} }
int main() { int main() {
const std::string input_name = "../../../data/bunny.off"; const std::string input_name = CGAL::data_file_path("bunny.off");
const int n_voxels = 20; const int n_voxels = 20;
const FT offset_value = -0.03; const FT offset_value = -0.03;
@ -89,7 +89,7 @@ int main() {
Polygon_range polygons; Polygon_range polygons;
// execute marching cubes with an isovalue equal to the offset // execute marching cubes with an isovalue equal to the offset
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, offset_value, points, polygons); CGAL::Isosurfacing::marching_cubes(domain, offset_value, points, polygons);
// save the result in the OFF format // save the result in the OFF format
CGAL::IO::write_OFF("result.off", points, polygons); CGAL::IO::write_OFF("result.off", points, polygons);

View File

@ -72,8 +72,7 @@ int main() {
{ {
ScopeTimer timer; ScopeTimer timer;
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring<CGAL::Parallel_tag>(implicit_domain, 0.8f, points, CGAL::Isosurfacing::dual_contouring<CGAL::Parallel_tag>(implicit_domain, 0.8f, points, polygons);
polygons);
} }
// TODO: compare results with mesh_3 // TODO: compare results with mesh_3

View File

@ -13,8 +13,7 @@ struct Sphere_function {
template <class Domain_> template <class Domain_>
void run(const Domain_& domain, const FT iso_value, Point_range& points, Polygon_range& polygons) { void run(const Domain_& domain, const FT iso_value, Point_range& points, Polygon_range& polygons) {
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes<CGAL::Parallel_tag>(domain, iso_value, points, CGAL::Isosurfacing::marching_cubes<CGAL::Parallel_tag>(domain, iso_value, points, polygons);
polygons);
} }
void test_implicit_sphere() { void test_implicit_sphere() {