0

I found that for BGL computations on

CGAL::Polyhedron_3<K,CGAL::Polyhedron_items_with_id_3>

the squared distance is used for edge weigths, which is defined in: CGAL/boost/graph/properties_Polyhedron_3.h

This produces wrong results on polyhedral meshes.

How can I change the weight metric without changing CGAL code?

My work around is that I change

reference operator[](key_type const& e) const
  {
    return CGAL::squared_distance(e->vertex()->point(), e->opposite()->vertex()->point());
  }

in class Polyhedron_edge_weight_map to

reference operator[](key_type const& e) const
  {
    return sqrt(CGAL::squared_distance(e->vertex()->point(), e->opposite()->vertex()->point()));
  }

Any ideas?

thanks and the best, Thomas

tm.tu
  • 1

1 Answers1

1

Note that the weightmap is a parameter of the function dijksta_shortest_path

Andreas Fabri
  • 1,144
  • 6
  • 9
  • Do you know how to assign weights to an weightmap of a polyhedron? I've tried it with get(boost::edge_weight, polyhedron) but I can only read the values and not write them. – tm.tu Apr 14 '14 at 13:39