mirror of https://github.com/CGAL/cgal
Rename algorithms and use data_file_path
This commit is contained in:
parent
b10a086fe6
commit
5c1ad94140
|
|
@ -247,15 +247,13 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
#if defined ALGO_MARCHING_CUBES
|
||||
std::cout << "ALGO_MARCHING_CUBES" << std::endl;
|
||||
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes<Tag>(scenario.domain(), scenario.iso(), points,
|
||||
polygons);
|
||||
CGAL::Isosurfacing::marching_cubes<Tag>(scenario.domain(), scenario.iso(), points, polygons, false);
|
||||
#elif defined ALGO_DUAL_CONTOURING
|
||||
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
|
||||
std::cout << "no algorithm selected!" << std::endl;
|
||||
CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes<Tag>(scenario.domain(), scenario.iso(), points,
|
||||
polygons);
|
||||
CGAL::Isosurfacing::marching_cubes<Tag>(scenario.domain(), scenario.iso(), points, polygons);
|
||||
#endif
|
||||
|
||||
const int64_t ms = timer.stop();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <CGAL/Dual_contouring_3.h>
|
||||
#include <CGAL/Marching_cubes_3.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/TC_marching_cubes_3.h>
|
||||
#include <CGAL/boost/graph/IO/OFF.h>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
|
|
@ -68,9 +67,8 @@ int main() {
|
|||
Polygon_range polygons_mc, polygons_tmc, polygons_dc;
|
||||
|
||||
// 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::make_triangle_mesh_using_tmc(domain, 0.88, points_tmc, polygons_tmc);
|
||||
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.88, points_dc, polygons_dc);
|
||||
CGAL::Isosurfacing::marching_cubes(domain, 0.88, points_mc, polygons_mc);
|
||||
CGAL::Isosurfacing::dual_contouring(domain, 0.88, points_dc, polygons_dc);
|
||||
|
||||
// save the results in the OFF format
|
||||
CGAL::IO::write_OFF("result_mc.off", points_mc, polygons_mc);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ int main() {
|
|||
Point_range points;
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ int main() {
|
|||
Polygon_range polygons;
|
||||
|
||||
// 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
|
||||
CGAL::IO::write_OFF("result.off", points, polygons);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ typedef std::vector<Point> Point_range;
|
|||
typedef std::vector<std::vector<std::size_t>> Polygon_range;
|
||||
|
||||
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 FT offset_value = 0.01;
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ int main() {
|
|||
Point_range points;
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ int main() {
|
|||
Point_range points;
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ int main() {
|
|||
Polygon_range polygons;
|
||||
|
||||
// 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
|
||||
CGAL::IO::write_OFF("result.off", points, polygons);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ int main() {
|
|||
Polygon_range polygons;
|
||||
|
||||
// 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
|
||||
CGAL::IO::write_OFF("result.off", points, polygons);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ typedef std::vector<std::vector<std::size_t>> Polygon_range;
|
|||
|
||||
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
|
||||
CGAL::Image_3 image;
|
||||
|
|
@ -34,7 +34,7 @@ int main() {
|
|||
Polygon_range polygons;
|
||||
|
||||
// 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
|
||||
CGAL::IO::write_OFF("result.off", points, polygons);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) {
|
|||
}
|
||||
|
||||
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 FT offset_value = -0.03;
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ int main() {
|
|||
Polygon_range polygons;
|
||||
|
||||
// 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
|
||||
CGAL::IO::write_OFF("result.off", points, polygons);
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ int main() {
|
|||
|
||||
{
|
||||
ScopeTimer timer;
|
||||
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring<CGAL::Parallel_tag>(implicit_domain, 0.8f, points,
|
||||
polygons);
|
||||
CGAL::Isosurfacing::dual_contouring<CGAL::Parallel_tag>(implicit_domain, 0.8f, points, polygons);
|
||||
}
|
||||
|
||||
// TODO: compare results with mesh_3
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ struct Sphere_function {
|
|||
|
||||
template <class Domain_>
|
||||
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,
|
||||
polygons);
|
||||
CGAL::Isosurfacing::marching_cubes<CGAL::Parallel_tag>(domain, iso_value, points, polygons);
|
||||
}
|
||||
|
||||
void test_implicit_sphere() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue