selfintersect.cpp 1.4 KB

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