orient3D.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingan Zhou <[email protected]>
  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. #ifndef IGL_COPYLEFT_CGAL_ORIENT_3D_H
  9. #define IGL_COPYLEFT_CGAL_ORIENT_3D_H
  10. #include "../../igl_inline.h"
  11. namespace igl
  12. {
  13. namespace copyleft
  14. {
  15. namespace cgal
  16. {
  17. /// Tests whether a point is above, on, or below a plane.
  18. ///
  19. /// @param[in] pa 3D point on plane
  20. /// @param[in] pb 3D point on plane
  21. /// @param[in] pc 3D point on plane
  22. /// @param[in] pd 3D point to test
  23. /// @return 1 if pa,pb,pc,pd forms a tet of positive volume.
  24. /// 0 if pa,pb,pc,pd are coplanar.
  25. /// -1 if pa,pb,pc,pd forms a tet of negative volume.
  26. template <typename Scalar>
  27. IGL_INLINE short orient3D(
  28. const Scalar pa[3],
  29. const Scalar pb[3],
  30. const Scalar pc[3],
  31. const Scalar pd[3]);
  32. }
  33. }
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "orient3D.cpp"
  37. #endif
  38. #endif