Created
October 21, 2021 06:46
-
-
Save afabri/1fc3f58b588e5318ffd279abb13b26f8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | |
#include <CGAL/optimal_bounding_box.h> | |
#include <fstream> | |
#include <iostream> | |
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; | |
typedef K::Point_3 Point; | |
int main(int argc, char** argv) | |
{ | |
const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; | |
std::ifstream in(filename); | |
std::vector<Point> points; | |
Point p; | |
while(in >> p){ | |
points.push_back(p); | |
} | |
// Compute the extreme points of the mesh, and then a tightly fitted oriented bounding box | |
std::array<Point, 8> obb_points; | |
CGAL::oriented_bounding_box(points, obb_points, | |
CGAL::parameters::use_convex_hull(true)); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment