This repository contains an C++ implementation of 3D-ConvexHull algorithm from the
book Computational Geometry in C by O'Rourke. RVIZ is used for visualization but is
not required to use this package. This code is implemented with C++11 STL conta-
iners only. The files are well documented, feel free to poke around.
catkin_make
source devel/setup.bash
roscore
rosrun convexhull_demo convex_node
rviz
cd /src
g++ -std=c++11 convexhull.cpp plain_demo.cpp -o test.o && ./test.o
Although in this example pcl pointcloud was used, the interface is a template
function that takes any vector with points (expect to have field x, y and z)
func(pcl::PointCloud<pcl::PointXYZI>::Ptr PC, Point3D& p)
{
Convexhull ch(PC->points);
if(ch.Contains(p)) // surface point is consider outside
{
//do something
}
auto vertices = ch.GetVertices();
auto faces = ch.GetFaces();
...
}
ConvexHull()
--ConstructHull()
-- BulildFirstHull()
-- Colinear()
-- Coplanar()
-- AddOneFace()
-- IncreHull()
-- VolumeSign()
-- AddOneFace()
-- CleanUp()
-- ExtractExteriorPoints()
MIT License