selfintersect.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. Eigen::VectorXi & J)
  20. {
  21. using namespace std;
  22. if(params.detect_only)
  23. {
  24. //// This is probably a terrible idea, but CGAL is throwing floating point
  25. //// exceptions.
  26. //#ifdef __APPLE__
  27. //#define IGL_THROW_FPE 11
  28. // const auto & throw_fpe = [](int e)
  29. // {
  30. // throw "IGL_THROW_FPE";
  31. // };
  32. // signal(SIGFPE,throw_fpe);
  33. //#endif
  34. typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
  35. SelfIntersectMesh<Kernel> SIM = SelfIntersectMesh<Kernel>(V,F,params,VV,FF,IF,J);
  36. //#ifdef __APPLE__
  37. // signal(SIGFPE,SIG_DFL);
  38. //#endif
  39. }else
  40. {
  41. typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
  42. SelfIntersectMesh<Kernel> SIM = SelfIntersectMesh<Kernel>(V,F,params,VV,FF,IF,J);
  43. }
  44. }