File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ target_include_directories(${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
9393# CGAL (header-only) ------------------------------------------------------
9494target_include_directories (${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /deps/cgal/include )
9595
96+ # Cilantro (header-only) --------------------------------------------------
97+ target_include_directories (${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /deps/cilantro/include )
9698# loguru (header-only) ----------------------------------------------------
9799download_submodule_project(loguru)
98100add_subdirectory (deps/loguru)
Original file line number Diff line number Diff line change @@ -125,4 +125,15 @@ namespace diffCheck::geometry
125125 this ->Colors = cloud->Colors ;
126126 this ->Normals = cloud->Normals ;
127127 }
128+
129+ Eigen::Vector3d DFPointCloud::GetCenterPoint ()
130+ {
131+ if (this ->Points .size () == 0 )
132+ throw std::invalid_argument (" The point cloud is empty." );
133+ Eigen::Vector3d center = Eigen::Vector3d::Zero ();
134+ for (auto &point : this ->Points )
135+ center += point;
136+ center /= this ->Points .size ();
137+ return center;
138+ }
128139}
Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ namespace diffCheck::geometry
103103 int GetNumColors () const { return this ->Colors .size (); }
104104 // / @brief Number of normals in the point cloud
105105 int GetNumNormals () const { return this ->Normals .size (); }
106+ // / @brief Get the center point of the point cloud
107+ Eigen::Vector3d GetCenterPoint ();
106108
107109 // / @brief Check if the cloud has points
108110 bool HasPoints () const { return this ->Points .size () > 0 ; }
You can’t perform that action at this time.
0 commit comments