// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 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 "outer_hull.h" #include "extract_cells.h" #include "remesh_self_intersections.h" #include "assign.h" #include "../../remove_unreferenced.h" #include #include #include #include #include template < typename DerivedV, typename DerivedF, typename DerivedHV, typename DerivedHF, typename DerivedJ, typename Derivedflip> IGL_INLINE void igl::copyleft::cgal::outer_hull( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & HV, Eigen::PlainObjectBase & HF, Eigen::PlainObjectBase & J, Eigen::PlainObjectBase & flip) { // Exact types typedef CGAL::Epeck Kernel; typedef Kernel::FT ExactScalar; typedef Eigen::Matrix< ExactScalar, Eigen::Dynamic, Eigen::Dynamic, DerivedHV::IsRowMajor> MatrixXES; // Remesh self-intersections MatrixXES Vr; DerivedHF Fr; DerivedJ Jr; { RemeshSelfIntersectionsParam params; params.stitch_all = true; Eigen::VectorXi I; Eigen::MatrixXi IF; remesh_self_intersections(V, F, params, Vr, Fr, IF, Jr, I); // Merge coinciding vertices into non-manifold vertices. std::for_each(Fr.data(), Fr.data()+Fr.size(), [&I](typename DerivedHF::Scalar& a) { a=I[a]; }); // Remove unreferenced vertices. Eigen::VectorXi UIM; remove_unreferenced(MatrixXES(Vr),DerivedHF(Fr), Vr, Fr, UIM); } // Extract cells for each face Eigen::MatrixXi C; extract_cells(Vr,Fr,C); // Extract faces on ambient cell int num_outer = 0; for(int i = 0;i, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #ifdef WIN32 #endif #endif