Browse Source

fix issue for octree. (#1171)

For translating centre, the distance should be the half of width of the sub cell instead of the width h.
X.ZhaoMa 6 years ago
parent
commit
fbcb933c5b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/igl/octree.cpp

+ 1 - 1
include/igl/octree.cpp

@@ -106,7 +106,7 @@ namespace igl {
         for(ChildrenType i = 0; i < 8; i++){
         for(ChildrenType i = 0; i < 8; i++){
           children.emplace_back(neg_ones);
           children.emplace_back(neg_ones);
           point_indices.emplace_back(std::vector<IndexType>());
           point_indices.emplace_back(std::vector<IndexType>());
-          centers.emplace_back(translate_center(curr_center,h,i));
+          centers.emplace_back(translate_center(curr_center,h/2,i));
           widths.emplace_back(h);
           widths.emplace_back(h);
         }
         }