mirror of https://github.com/CGAL/cgal
fixing generated indices of coplanar convex_hull_3
adding a small test
This commit is contained in:
parent
0fc710e95d
commit
4c1400d2fb
|
|
@ -62,9 +62,9 @@ void copy_ch2_to_face_graph(const std::list<P>& CH_2,
|
|||
|
||||
for(std::size_t i = 1; i < CH_2.size()-1; ++i){
|
||||
CGAL::internal::resize(its.faces[i-1], 3);
|
||||
its.faces[i-1][0] = static_cast<Index>(i);
|
||||
its.faces[i-1][1] = static_cast<Index>(i + 1);
|
||||
its.faces[i-1][2] = static_cast<Index>(i + 2);
|
||||
its.faces[i-1][0] = static_cast<Index>(i - 1);
|
||||
its.faces[i-1][1] = static_cast<Index>(i);
|
||||
its.faces[i-1][2] = static_cast<Index>(i + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,6 +186,13 @@ int main()
|
|||
Triangle_3 ch_triangle;
|
||||
assert(CGAL::assign(ch_triangle, ch_object));
|
||||
|
||||
std::vector<Point_3> pts;
|
||||
std::vector<std::array<int, 3> > faces;
|
||||
CGAL::convex_hull_3(points.begin(), points.end(), pts, faces);
|
||||
assert(faces.size() == 1);
|
||||
for (int i : faces[0])
|
||||
assert(0 <= i && i <= 2);
|
||||
|
||||
std::cout << "Testing hull of four points " << std::endl;
|
||||
Point_3 p4(1, 1, 1);
|
||||
points.push_back(p4);
|
||||
|
|
|
|||
Loading…
Reference in New Issue