Skip to content

Commit 4167c31

Browse files
Amal Dev ParakkatAmal Dev Parakkat
Amal Dev Parakkat
authored and
Amal Dev Parakkat
committed
Edits from Amal
1 parent e6677cf commit 4167c31

21 files changed

+259
-2501
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 3.1...3.23)
2+
project(Ball_merge)
3+
4+
find_package(CGAL REQUIRED)
5+
6+
include_directories( ../../include)
7+
create_single_source_cgal_program("ball_merge_reconstruction.cpp")
8+
9+
find_package(TBB QUIET)
10+
include(CGAL_TBB_support)
11+
if(TARGET CGAL::TBB_support)
12+
target_link_libraries(ball_merge_reconstruction PUBLIC CGAL::TBB_support)
13+
else()
14+
message(STATUS "NOTICE: Intel TBB was not found. Parallel code will not be used.")
15+
endif()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
2+
#include <CGAL/Ball_merge_surface_reconstruction.h>
3+
#include <CGAL/IO/polygon_soup_io.h>
4+
#include <CGAL/IO/read_points.h>
5+
6+
#include <string>
7+
8+
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
9+
typedef K::Point_3 Point;
10+
11+
int main(int argc, char **argv)
12+
{
13+
std::string inFilename=CGAL::data_file_path("points_3/half.xyz"); //Test input file
14+
std::vector<Point> points;
15+
CGAL::IO::read_points(inFilename, std::back_inserter(points)); //Reading the input points
16+
17+
std::vector<std::array<int,3>> meshFaceIndices1, meshFaceIndices2; //For saving the results
18+
CGAL::ball_merge_surface_reconstruction_global<CGAL::Parallel_if_available_tag>(points, meshFaceIndices1, meshFaceIndices2, 1.7); //Calling global BallMerge with parameter=1.7
19+
CGAL::IO::write_polygon_soup("BMOut1.ply", points, meshFaceIndices1); //The first resulting mesh
20+
CGAL::IO::write_polygon_soup("BMOut2.ply", points, meshFaceIndices2); //The second resulting mesh
21+
22+
return 0;
23+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
2+
#include <CGAL/Ball_merge_surface_reconstruction.h>
3+
#include <CGAL/IO/polygon_soup_io.h>
4+
#include <CGAL/IO/read_points.h>
5+
6+
// #include <fstream>
7+
// #include <sstream>
8+
// #include <iostream>
9+
// #include <string>
10+
11+
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
12+
typedef K::Point_3 Point;
13+
14+
int main(int argc, char **argv)
15+
{
16+
const char *inFilename = CGAL::data_file_path("points_3/kitten.xyz"));//Filename
17+
std::ifstream inStream(inFilename);//Read the file
18+
// std::vector<std::array<unsigned char, 3>> meshVertexColors;//Variable to hold if the input has textures
19+
// double par = atof(argv[2]);//Parameter to check IR
20+
// int option = atoi(argv[3]);//Option to select global and local variants - 1 for global and 0 for local
21+
22+
std::vector<Point> points;
23+
CGAL::IO::read_points(argv[1], std::back_inserter(points));
24+
25+
std::vector<std::array<int,3>> meshFaceIndices1, meshFaceIndices2;
26+
CGAL::ball_merge_surface_reconstruction_global<CGAL::Parallel_if_available_tag>(points, meshFaceIndices1, meshFaceIndices2, 1.7);
27+
CGAL::IO::write_polygon_soup("BMOut1.ply", points, meshFaceIndices1);
28+
CGAL::IO::write_polygon_soup("BMOut2.ply", points, meshFaceIndices2);
29+
30+
// if (option == 0)
31+
// {
32+
// double eta = (argc >= 5) ? atof(argv[4]) : 200.;
33+
// std::vector<std::array<int,3>> meshFaceIndices;
34+
// CGAL::ball_merge_surface_reconstruction_local<CGAL::Parallel_if_available_tag>(points, meshFaceIndices, par, eta);
35+
// CGAL::IO::write_polygon_soup("BMOut1.ply", points, meshFaceIndices);
36+
// }
37+
// else{
38+
// std::vector<std::array<int,3>> meshFaceIndices1, meshFaceIndices2;
39+
// CGAL::ball_merge_surface_reconstruction_global<CGAL::Parallel_if_available_tag>(points, meshFaceIndices1, meshFaceIndices2, par);
40+
// CGAL::IO::write_polygon_soup("BMOut1.ply", points, meshFaceIndices1);
41+
// CGAL::IO::write_polygon_soup("BMOut2.ply", points, meshFaceIndices2);
42+
// }
43+
44+
return 0;
45+
}

Ball_merge_surface_reconstruction/attic/AutomaticBallMerge.cpp

Lines changed: 0 additions & 225 deletions
This file was deleted.

0 commit comments

Comments
 (0)