// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2017 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "convex_hull.h" #include "../../ismember.h" #include "polyhedron_to_mesh.h" #include #include #include #include #include template < typename DerivedV, typename DerivedW, typename DerivedG> IGL_INLINE void igl::copyleft::cgal::convex_hull( const Eigen::MatrixBase & V, Eigen::PlainObjectBase & W, Eigen::PlainObjectBase & G) { typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point_3; //typedef CGAL::Delaunay_triangulation_3 Delaunay; //typedef Delaunay::Vertex_handle Vertex_handle; //typedef CGAL::Surface_mesh Surface_mesh; typedef CGAL::Polyhedron_3 Polyhedron_3; std::vector points(V.rows()); for(int i = 0;i IGL_INLINE void igl::copyleft::cgal::convex_hull( const Eigen::MatrixBase & V, Eigen::PlainObjectBase & F) { Eigen::Matrix W; Eigen::Matrix G; convex_hull(V,W,G); // This is a lazy way to reindex into the original mesh Eigen::Matrix I; Eigen::VectorXi J; igl::ismember_rows(W,V,I,J); assert(I.all() && "Should find all W in V"); F.resizeLike(G); for(int f = 0;f, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); #endif