selfintersect.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "selfintersect.h"
  9. #include "SelfIntersectMesh.h"
  10. #include <igl/C_STR.h>
  11. #include <list>
  12. IGL_INLINE void igl::selfintersect(
  13. const Eigen::MatrixXd & V,
  14. const Eigen::MatrixXi & F,
  15. const SelfintersectParam & params,
  16. Eigen::MatrixXd & VV,
  17. Eigen::MatrixXi & FF,
  18. Eigen::MatrixXi & IF)
  19. {
  20. using namespace std;
  21. if(params.detect_only)
  22. {
  23. //// This is probably a terrible idea, but CGAL is throwing floating point
  24. //// exceptions.
  25. //#ifdef __APPLE__
  26. //#define IGL_THROW_FPE 11
  27. // const auto & throw_fpe = [](int e)
  28. // {
  29. // throw "IGL_THROW_FPE";
  30. // };
  31. // signal(SIGFPE,throw_fpe);
  32. //#endif
  33. typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
  34. SelfIntersectMesh<Kernel> SIM = SelfIntersectMesh<Kernel>(V,F,params,VV,FF,IF);
  35. //#ifdef __APPLE__
  36. // signal(SIGFPE,SIG_DFL);
  37. //#endif
  38. }else
  39. {
  40. typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
  41. SelfIntersectMesh<Kernel> SIM = SelfIntersectMesh<Kernel>(V,F,params,VV,FF,IF);
  42. }
  43. }