Welcome to mirror list, hosted at ThFree Co, Russian Federation.

edges_to_path.h « igl « src « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 403e7029aedbe6457de8abcae6a83176bf27aabb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef IGL_EDGES_TO_PATH_H
#define IGL_EDGES_TO_PATH_H
#include "igl_inline.h"
#include <Eigen/Core>
namespace igl
{
  // EDGES_TO_PATH Given a set of undirected, unique edges such that all form a
  // single connected compoent with exactly 0 or 2 nodes with valence =1,
  // determine the/a path visiting all nodes.
  //
  // Inputs:
  //   E  #E by 2 list of undirected edges
  // Outputs:
  //   I  #E+1 list of nodes in order tracing the chain (loop), if the output
  //     is a loop then I(1) == I(end)
  //   J  #I-1 list of indices into E of edges tracing I
  //   K  #I-1 list of indices into columns of E {1,2} so that K(i) means that
  //     E(i,K(i)) comes before the other (i.e., E(i,3-K(i)) ). This means that 
  //     I(i) == E(J(i),K(i)) for i<#I, or
  //     I == E(sub2ind(size(E),J([1:end end]),[K;3-K(end)]))))
  // 
  template <
    typename DerivedE,
    typename DerivedI,
    typename DerivedJ,
    typename DerivedK>
  IGL_INLINE void edges_to_path(
    const Eigen::MatrixBase<DerivedE> & E,
    Eigen::PlainObjectBase<DerivedI> & I,
    Eigen::PlainObjectBase<DerivedJ> & J,
    Eigen::PlainObjectBase<DerivedK> & K);
}
#ifndef IGL_STATIC_LIBRARY
#  include "edges_to_path.cpp"
#endif
#endif