wire_mesh.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef IGL_COPYLEFT_CGAL_WIRE_MESH_H
  2. #define IGL_COPYLEFT_CGAL_WIRE_MESH_H
  3. #include "../../igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. namespace copyleft
  8. {
  9. // Construct a "wire" or "wireframe" or "strut" surface mesh, given a
  10. // one-dimensional network of straight edges.
  11. //
  12. // Inputs:
  13. // WV #WV by 3 list of vertex positions
  14. // WE #WE by 2 list of edge indices into WV
  15. // th diameter thickness of wire
  16. // poly_size number of sides on each wire (e.g., 4 would produce wires by
  17. // connecting rectangular prisms).
  18. // Outputs:
  19. // V #V by 3 list of output vertices
  20. // F #F by 3 list of output triangle indices into V
  21. // J #F list of indices into [0,#WV+#WE) revealing "birth simplex" of
  22. // output faces J(j) < #WV means the face corresponds to the J(j)th
  23. // vertex in WV. J(j) >= #WV means the face corresponds to the
  24. // (J(j)-#WV)th edge in WE.
  25. namespace cgal
  26. {
  27. template <
  28. typename DerivedWV,
  29. typename DerivedWE,
  30. typename DerivedV,
  31. typename DerivedF,
  32. typename DerivedJ>
  33. IGL_INLINE void wire_mesh(
  34. const Eigen::MatrixBase<DerivedWV> & WV,
  35. const Eigen::MatrixBase<DerivedWE> & WE,
  36. const double th,
  37. const int poly_size,
  38. Eigen::PlainObjectBase<DerivedV> & V,
  39. Eigen::PlainObjectBase<DerivedF> & F,
  40. Eigen::PlainObjectBase<DerivedJ> & J);
  41. }
  42. }
  43. }
  44. #ifndef IGL_STATIC_LIBRARY
  45. # include "wire_mesh.cpp"
  46. #endif
  47. #endif