Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing signed distance for cloud-to-cloud #32

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"cwctype": "cpp",
"memory_resource": "cpp",
"scoped_allocator": "cpp",
"strstream": "cpp"
"strstream": "cpp",
"core": "cpp"
}
}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ if (BUILD_PYTHON_MODULE)
)

# get all the files -dlls in the bin directory and copy them one by one to the pypi directory
message(STATUS "Copying dlls to ${TARGET_DLL_PYPI_DIR}")
file(GLOB files ${CMAKE_BINARY_DIR}/bin/Release/*.dll)
foreach(file ${files})
message(STATUS "Copying ${file} to ${TARGET_DLL_PYPI_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion deps/eigen
Submodule eigen updated from 02bcf9 to d791d4
5 changes: 1 addition & 4 deletions src/diffCheck/geometry/DFPointCloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,13 @@ namespace diffCheck::geometry
this->Normals = cloud->Normals;
}

std::vector<double> DFPointCloud::ComputeDistance(const diffCheck::geometry::DFPointCloud &targetCloud, bool useAbs)
std::vector<double> DFPointCloud::ComputeDistance(const diffCheck::geometry::DFPointCloud &targetCloud)
{
auto O3DSourcePointCloud = this->Cvt2O3DPointCloud();
auto targetCloudCopy = targetCloud;
auto O3DTargetPointCloud = targetCloudCopy.Cvt2O3DPointCloud();
std::vector<double> distances;
distances = O3DSourcePointCloud->ComputePointCloudDistance(*O3DTargetPointCloud);
if (useAbs)
for (auto &dist : distances)
dist = std::abs(dist);
return distances;
}
}
3 changes: 1 addition & 2 deletions src/diffCheck/geometry/DFPointCloud.hh
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ namespace diffCheck::geometry
* It returns a vector of distances, one for each point in the source point cloud.
*
* @param target the target point cloud in format df
* @param useAbs if true, the absolute value of the distance is returned
* @return std::vector<double> the distance between the two point clouds
*
* @see https://github.com/isl-org/Open3D/blob/main/cpp/open3d/geometry/PointCloud.cpp
*/
std::vector<double> ComputeDistance(const DFPointCloud &targetCloud, bool useAbs = true);
std::vector<double> ComputeDistance(const DFPointCloud &targetCloud);

public: ///< Getters
/// @brief Number of points in the point cloud
Expand Down
3 changes: 1 addition & 2 deletions src/diffCheckBindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ PYBIND11_MODULE(diffcheck_bindings, m) {
.def(py::init<std::vector<Eigen::Vector3d>, std::vector<Eigen::Vector3d>, std::vector<Eigen::Vector3d>>())

.def("compute_distance", &diffCheck::geometry::DFPointCloud::ComputeDistance,
py::arg("target_cloud"),
py::arg("is_abs") = true)
py::arg("target_cloud"))
.def("compute_BoundingBox", &diffCheck::geometry::DFPointCloud::ComputeBoundingBox)

.def("voxel_downsample", &diffCheck::geometry::DFPointCloud::VoxelDownsample,
Expand Down
8 changes: 4 additions & 4 deletions src/gh/examples/compute_distance.ghx

Large diffs are not rendered by default.