mirror of https://github.com/CGAL/cgal
handle empty meshes
This commit is contained in:
parent
7c99d5bc80
commit
0f0f03e08b
|
|
@ -76,13 +76,12 @@ namespace CGAL {
|
||||||
GT gt = choose_param(get_param(np, internal_np::geom_traits), GT());
|
GT gt = choose_param(get_param(np, internal_np::geom_traits), GT());
|
||||||
typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object();
|
typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object();
|
||||||
|
|
||||||
typedef typename boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;
|
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
|
||||||
|
|
||||||
halfedge_descriptor h0 = *(halfedges(pmesh).first);
|
CGAL::Bbox_3 bb;
|
||||||
CGAL::Bbox_3 bb = get(vpm, target(h0, pmesh)).bbox();
|
BOOST_FOREACH(vertex_descriptor v, vertices(pmesh))
|
||||||
BOOST_FOREACH(halfedge_descriptor h, halfedges(pmesh))
|
|
||||||
{
|
{
|
||||||
bb += get_bbox( get(vpm, target(h, pmesh)) );
|
bb += get_bbox( get(vpm, v) );
|
||||||
}
|
}
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue