Skip to content

Commit fcc1936

Browse files
feat: add point cloud duplication for python binding
1 parent a98b80f commit fcc1936

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/diffCheck/geometry/DFPointCloud.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ namespace diffCheck::geometry
231231
this->Normals.push_back(normal);
232232
}
233233

234+
DFPointCloud DFPointCloud::Duplicate() const
235+
{
236+
return DFPointCloud(this->Points, this->Colors, this->Normals);
237+
}
238+
234239
void DFPointCloud::UniformDownsample(int everyKPoints)
235240
{
236241
auto O3DPointCloud = this->Cvt2O3DPointCloud();

src/diffCheck/geometry/DFPointCloud.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ namespace diffCheck::geometry
9797
*/
9898
void Crop(const Eigen::Vector3d &minBound, const Eigen::Vector3d &maxBound);
9999

100+
/**
101+
* @brief Get the duplicate of the point cloud. This is mainly used in the python bindings
102+
*
103+
* @return DFPointCloud a copy of the point cloud
104+
*/
105+
diffCheck::geometry::DFPointCloud Duplicate() const;
106+
100107
public: ///< Downsamplers
101108
/**
102109
* @brief Downsample the point cloud with voxel grid

src/diffCheckBindings.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ PYBIND11_MODULE(diffcheck_bindings, m) {
5757

5858
.def("remove_statistical_outliers", &diffCheck::geometry::DFPointCloud::RemoveStatisticalOutliers,
5959
py::arg("nb_neighbors"), py::arg("std_ratio"))
60+
6061
.def("crop", &diffCheck::geometry::DFPointCloud::Crop,
6162
py::arg("min_bound"), py::arg("max_bound"))
6263

64+
.def("duplicate", &diffCheck::geometry::DFPointCloud::Duplicate)
65+
6366
.def("load_from_PLY", &diffCheck::geometry::DFPointCloud::LoadFromPLY)
6467
.def("save_to_PLY", &diffCheck::geometry::DFPointCloud::SaveToPLY)
6568

0 commit comments

Comments
 (0)