per_edge_normals.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef IGL_PER_EDGE_NORMALS_H
  9. #define IGL_PER_EDGE_NORMALS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Compute face normals via vertex position list, face list
  15. // Inputs:
  16. // V #V by 3 eigen Matrix of mesh vertex 3D positions
  17. // F #F by 3 eigen Matrix of face (triangle) indices
  18. // Output:
  19. // N #2 by 3 matrix of mesh edge 3D normals per row
  20. // E #E by 2 matrix of edge indices per row
  21. // EMAP #E by 1 matrix of indices from all edges to E
  22. //
  23. template <
  24. typename DerivedV,
  25. typename DerivedF,
  26. typename DerivedN,
  27. typename DerivedE,
  28. typename DerivedEMAP>
  29. IGL_INLINE void per_edge_normals(
  30. const Eigen::PlainObjectBase<DerivedV>& V,
  31. const Eigen::PlainObjectBase<DerivedF>& F,
  32. Eigen::PlainObjectBase<DerivedN> & N,
  33. Eigen::PlainObjectBase<DerivedE> & E,
  34. Eigen::PlainObjectBase<DerivedEMAP> & EMAP);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "per_edge_normals.cpp"
  38. #endif
  39. #endif