зеркало из https://github.com/microsoft/O-CNN.git
Fix the error in octree_test
This commit is contained in:
Родитель
c22cc51cb7
Коммит
533420467d
|
@ -1250,7 +1250,7 @@ void Octree::octree2mesh(vector<float>& V, vector<int>& F, int depth_start,
|
|||
node_normal(n, i, d);
|
||||
float len = fabsf(n[0]) + fabsf(n[1]) + fabsf(n[2]);
|
||||
if (len == 0) continue;
|
||||
node_pos(pt, i, d, pt_ref);
|
||||
node_pos(pt, i, d, pt_ref, true); // !!! set clp as true in node_pos()
|
||||
|
||||
for (int c = 0; c < 3; ++c) {
|
||||
normals.push_back(n[c]);
|
||||
|
|
|
@ -92,7 +92,8 @@ float* OctreeParser::mutable_split_cpu(const int depth) {
|
|||
|
||||
|
||||
//////////////////////////////////////
|
||||
void OctreeParser::node_pos(float* xyz, int id, int depth, float* xyz_base) const {
|
||||
void OctreeParser::node_pos(float* xyz, int id, int depth,
|
||||
float* xyz_base, bool clp) const {
|
||||
float tmp[3];
|
||||
const uintk* keyi = key_cpu(depth) + id;
|
||||
key2xyz(tmp, *keyi, depth);
|
||||
|
@ -117,7 +118,7 @@ void OctreeParser::node_pos(float* xyz, int id, int depth, float* xyz_base) cons
|
|||
node_normal(n, id, depth);
|
||||
for (int c = 0; c < 3; ++c) {
|
||||
xyz[c] += dis * n[c];
|
||||
xyz[c] = clamp(xyz[c], tmp[c] + v0, tmp[c] + v1);
|
||||
if (clp) { xyz[c] = clamp(xyz[c], tmp[c] + v0, tmp[c] + v1); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,8 @@ class OctreeParser {
|
|||
float* mutable_split_gpu(const int depth);
|
||||
|
||||
//////////////////////////////////////
|
||||
void node_pos(float* xyz, int id, int depth, float* xyz_base = nullptr) const;
|
||||
void node_pos(float* xyz, int id, int depth, float* xyz_base = nullptr,
|
||||
bool clp = false) const;
|
||||
void node_normal(float* n, int id, int depth) const;
|
||||
float node_dis(int id, int depth) const;
|
||||
template<typename Dtype>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <random>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
|
||||
#include "cmd_flags.h"
|
||||
#include "filenames.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче