I spent the day trying to achieve the following, with no luck. I have been able to attach an id to the vertices (vertex()->info()
) for some triangulations, with the help of std::pair
. But now I want to do so for a Poisson surface reconstruction, which uses a Polyhedron_3
as a mesh, and I don't manage. Doing the Poisson surface reconstruction requires to use points with normals. So, for the points, I defined pairs constituted of a pair (point, normal) and an integer; my inputs are a matrix of points pts
and a matrix of normals normals
(these matrices come from R which runs the C++ code):
const size_t npoints = pts.nrow();
std::vector<IP3wn> points(npoints);
for(size_t i = 0; i < npoints; i++) {
points[i] = std::make_pair(
std::make_pair(Point3(pts(i, 0), pts(i, 1), pts(i, 2)), i + 1),
Vector3(normals(i, 0), normals(i, 1), normals(i, 2)));
}
Polyhedron mesh;
But I can't access to the field info()
of the vertices:
for(Polyhedron::Facet_iterator fit = mesh.facets_begin();
fit != mesh.facets_end(); fit++) {
Polyhedron::Facet f = *fit;
facets(i, 0) = f.halfedge()->vertex()->info();
The error message claims that there is no member info
. Could you show me the right way please?