36 #ifndef PCL_SURFACE_IMPL_MARCHING_CUBES_HOPPE_H_
37 #define PCL_SURFACE_IMPL_MARCHING_CUBES_HOPPE_H_
39 #include <pcl/surface/marching_cubes_hoppe.h>
42 template <
typename Po
intNT>
47 template <
typename Po
intNT>
void
50 const bool is_far_ignored = dist_ignore_ > 0.0f;
52 for (
int x = 0; x < res_x_; ++x)
54 const int y_start = x * res_y_ * res_z_;
56 for (
int y = 0; y < res_y_; ++y)
58 const int z_start = y_start + y * res_z_;
60 for (
int z = 0; z < res_z_; ++z)
63 std::vector<float> nn_sqr_dists (1, 0.0f);
64 const Eigen::Vector3f point = (lower_boundary_ + size_voxel_ * Eigen::Array3f (x, y, z)).matrix ();
67 p.getVector3fMap () = point;
69 tree_->nearestKSearch (p, 1, nn_indices, nn_sqr_dists);
71 if (!is_far_ignored || nn_sqr_dists[0] < dist_ignore_)
73 const Eigen::Vector3f normal = (*input_)[nn_indices[0]].getNormalVector3fMap ();
75 if (!std::isnan (normal (0)) && normal.norm () > 0.5f)
76 grid_[z_start + z] = normal.dot (
77 point - (*input_)[nn_indices[0]].getVector3fMap ());
86 #define PCL_INSTANTIATE_MarchingCubesHoppe(T) template class PCL_EXPORTS pcl::MarchingCubesHoppe<T>;
~MarchingCubesHoppe() override
Destructor.
void voxelizeData() override
Convert the point cloud into voxel data.
IndicesAllocator<> Indices
Type used for indices in PCL.