Search code examples
boostcgal

Delaunay + Kruskal unknown zero point


I've got a strange behaviour when reading edges after applying Kruskal algo on a delaunay graph. When displaying the result edges, sometimes one point of some edge can be a point (always (0,0)) which hadn't been added in the graph points. Does someone know where that comes from?

for (i = 0; i < Max; i++)
{
    vertices.push_back(m_boostVector(data[i].x, data.y));
}
dt.insert(vertices.begin(), vertices.end());

for (index = 0, boost::tie(vit, ve) = boost::vertices(ft); vit != ve; vit++, index++)
{
    vertex_id_map[*vit] = index;
}

boost::kruskal_minimum_spanning_tree(dt, std::back_inserter(mst), vertex_index_map(vertex_index_pmap));

for (std::list<edge_descriptor>::iterator it = mst.begin(); it != mst.end(); it++)
{
    Delaunay::Vertex_handle sv = boost::source(*it, ft);
    Delaunay::Vertex_handle tv = boost::target(*it, ft);
}

Thanks


Solution

  • If you haven't filtered infinite edges, then you might end up accessing the infinite vertex. See the following section that contains an example showing how to do it.