Преглед изворни кода

Added convention that cell with index 0 is always the infinite cell.

Former-commit-id: db1a8187c7d395829ee2996f76cf60060750ea8e
Qingnan Zhou пре 9 година
родитељ
комит
5992675b89

+ 4 - 0
include/igl/copyleft/cgal/extract_cells.cpp

@@ -353,6 +353,10 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
 
     size_t count = 0;
     std::vector<size_t> mapped_indices(num_raw_cells+1, INVALID);
+    // Always map infinite cell to index 0.
+    mapped_indices[INFINITE_CELL] = count;
+    count++;
+
     for (size_t i=0; i<num_patches; i++) {
         const size_t old_positive_cell_id = raw_cells(i, 0);
         const size_t old_negative_cell_id = raw_cells(i, 1);

+ 2 - 0
include/igl/copyleft/cgal/extract_cells.h

@@ -27,6 +27,7 @@ namespace igl {
         //   cells  #F by 2 array of cell indices.  cells(i,0) represents the
         //          cell index on the positive side of face i, and cells(i,1)
         //          represents cell index of the negqtive side.
+        //          By convension cell with index 0 is the infinite cell.
         template<
             typename DerivedV,
             typename DerivedF,
@@ -51,6 +52,7 @@ namespace igl {
         //   cells  #P by 2 array of cell indices.  cells(i,0) represents the
         //          cell index on the positive side of patch i, and cells(i,1)
         //          represents cell index of the negqtive side.
+        //          By convension cell with index 0 is the infinite cell.
         template<
             typename DerivedV,
             typename DerivedF,