Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Parameterizing a Seam_mesh with a fixed border and mean value coordinates

Subject: CGAL users discussion list

List archive

[cgal-discuss] Parameterizing a Seam_mesh with a fixed border and mean value coordinates


Chronological Thread 
  • From: meder411 <>
  • To:
  • Subject: [cgal-discuss] Parameterizing a Seam_mesh with a fixed border and mean value coordinates
  • Date: Wed, 9 Oct 2019 14:43:36 -0500 (CDT)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
  • Ironport-phdr: 9a23:rIm3HxQs36KHs2/yi29xNZ13A9psv+yvbD5Q0YIujvd0So/mwa68bRON2/xhgRfzUJnB7Loc0qyK6vumBzVLuM/R+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAi4oAnLt8QanIRuJrssxhbKv3BFZ/lYyWR0KFyJgh3y/N2w/Jlt8yRRv/Iu6ctNWrjkcqo7ULJVEi0oP3g668P3uxbDSxCP5mYHXWUNjhVIGQnF4wrkUZr3ryD3q/By2CiePc3xULA0RTGv5LplRRP0lCsKMSMy/WfKgcJyka1bugqsqRJ/zYDKY4+bKfVxcb/Sc94BWWpBR9pdWzBdDo+gbYYCCfcKM+ZCr4n6olsDtR6+ChexC+zx0D9FiWL60bAn2OkmFAHJwhEvEMwUsHnPsNr1L70eUf2zzKbU1znMce5Z2Srk5YXObxsvr/aMXbdqfsrQz0kiDwXFgU+LpoP+OzOayP4BvHSc7+plU++klm0pqxlprzSywsohjpPFi4wWx1ze9ih0wZw5KNy5RUN9fNWqCoFftzuAOItzWs4iQ39nuCI9yrAev562czIGyJI9yBHEcPOHd5aH7gj/W+aWJDd0nHNleLShiBau6UWs1+nxW82u3FtErSdJiNrBu3EX2xHS68WLUv598V2g2TaL2QDT8OZEIUUsmKreNZEu36A/loAIvEvfBS/6glj2jKmKeUk+5Oen9vnnbq38ppCAL490lh3+MqM2l8OjDuQ3KAwOU3GG9uS9z73s4VD5QK5RjvAtianYsJXaJdwBqaKjAg9V1Jwj6xelADu83tQYhypPEFUQcx2Oi83lOkrFPevjJfa5mVWl1jlxlN7cObi0B5jBI2Kfye6pKbNw50NG4AEoi81Z7NRZBqxXc6G7YVP4qNGNVkxxCAez2euyUIwshLNbYnqGB+qiCI2XtFaJ4uw1JOzVPt0eo3DgLfNj6vLz3yRgxA0tOJKx1J5SU0iWW/RrJ0LAPCjq3pEHGG0Augd4R+vv2gTbDWxjIk2qVqd53QkVTZq8BN6ZFIu2xqGH12G2EoAEPm0=

I've successfully parameterized a Seam_mesh as described in this example.
However, when I try to "merge" the relevant code from the square border /
discrete conformal map parameterization example, I get compiler errors that
my code is invalid. And, unfortunately, a consequence of all the templating
in CGAL is that I really cannot make heads or tails of what the error is or
how to resolve it.

This is my function (quite similar to the examples):

void my_function(SurfaceMesh &input){
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Point_3 Point_3;
typedef SurfaceMesh PolyMesh;
typedef boost::graph_traits<PolyMesh>::edge_descriptor SM_edge_descriptor;
typedef boost::graph_traits<PolyMesh>::halfedge_descriptor
SM_halfedge_descriptor;
typedef boost::graph_traits<PolyMesh>::vertex_descriptor
SM_vertex_descriptor;
typedef CGAL::Unique_hash_map<SM_halfedge_descriptor, Point_2> UV_uhm;
typedef CGAL::Unique_hash_map<SM_edge_descriptor, bool> Seam_edge_uhm;
typedef CGAL::Unique_hash_map<SM_vertex_descriptor, bool> Seam_vertex_uhm;
typedef boost::associative_property_map<UV_uhm> UV_pmap;
typedef boost::associative_property_map<Seam_edge_uhm> Seam_edge_pmap;
typedef boost::associative_property_map<Seam_vertex_uhm> Seam_vertex_pmap;
typedef CGAL::Seam_mesh<PolyMesh, Seam_edge_pmap, Seam_vertex_pmap> Mesh;
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<Mesh>::halfedge_descriptor
halfedge_descriptor;
typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
namespace SMP = CGAL::Surface_mesh_parameterization;

// For the sake of following the example I do this assignment
PolyMesh sm = input;

// Two property maps to store the seam edges and vertices
Seam_edge_uhm seam_edge_uhm(false);
Seam_edge_pmap seam_edge_pm(seam_edge_uhm);
Seam_vertex_uhm seam_vertex_uhm(false);
Seam_vertex_pmap seam_vertex_pm(seam_vertex_uhm);
Mesh seam_mesh(sm, seam_edge_pm, seam_vertex_pm);

// This function simply returns a vector of <vertex_descriptor,
vertex_descriptor> defining a seam on the input mesh
const auto seam = constructSeam(input, SM_vertex_descriptor(0), seam_len);
for (const auto pair : seam) {
seam_mesh.add_seam(pair.first, pair.second);
}

// The 2D points of the uv parametrisation will be written into this map
// Note that this is a halfedge property map, and that uv values
// are only stored for the canonical halfedges representing a vertex
UV_uhm uv_uhm;
UV_pmap uv_pm(uv_uhm);

// A halfedge on the (possibly virtual) border
halfedge_descriptor bhd =
CGAL::Polygon_mesh_processing::longest_border(seam_mesh).first;

typedef SMP::Square_border_uniform_parameterizer_3<Mesh>
Border_parameterizer;
typedef SMP::Mean_value_coordinates_parameterizer_3<Mesh,
Border_parameterizer> Parameterizer;
Border_parameterizer border_param; // the border parameterizer will
compute the corner vertices
SMP::Error_code err =
SMP::parameterize(sm, Parameterizer(border_param), bhd, uv_pm);

std::ofstream out("result.off");
SMP::IO::output_uvmap_to_off(seam_mesh, bhd, uv_pm, out);
}


Here is the error:

/usr/local/include/CGAL/Surface_mesh_parameterization/parameterize.h: In
instantiation of ‘CGAL::Surface_mesh_parameterization::Error_code
CGAL::Surface_mesh_parameterization::parameterize(TriangleMesh&,
Parameterizer, HD, VertexUVmap) [with TriangleMesh =
CGAL::Surface_mesh<CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double> > >;
Parameterizer =
CGAL::Surface_mesh_parameterization::Mean_value_coordinates_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > >,
CGAL::Surface_mesh_parameterization::Square_border_uniform_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > > > >; HD =
CGAL::Seam_mesh_halfedge_descriptor<CGAL::SM_Halfedge_index>; VertexUVmap =
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Halfedge_index,
CGAL::Point_2&lt;CGAL::Simple_cartesian&lt;double> > > >]’:
ext_modules/src/util/cpp/triangle_mesh.cpp:829:68: required from here
/usr/local/include/CGAL/Surface_mesh_parameterization/parameterize.h:96:62:
error: no matching function for call to
‘CGAL::Surface_mesh_parameterization::Mean_value_coordinates_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > >,
CGAL::Surface_mesh_parameterization::Square_border_uniform_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > > >
>::parameterize(CGAL::Surface_mesh<CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >&, CGAL::Seam_mesh_halfedge_descriptor<CGAL::SM_Halfedge_index>&,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Halfedge_index,
CGAL::Point_2&lt;CGAL::Simple_cartesian&lt;double> > > >&,
boost::associative_property_map<boost::unordered::unordered_map&lt;CGAL::SM_Vertex_index,
int, boost::hash&lt;CGAL::SM_Vertex_index>,
std::equal_to<CGAL::SM_Vertex_index>, std::allocator<std::pair&lt;const
CGAL::SM_Vertex_index, int> > > >&,
CGAL::Surface_mesh_parameterization::internal::Bool_property_map<boost::unordered::unordered_set&lt;CGAL::SM_Vertex_index,
boost::hash&lt;CGAL::SM_Vertex_index>, std::equal_to<CGAL::SM_Vertex_index>,
std::allocator<CGAL::SM_Vertex_index> > >&)’
return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm);
^
In file included from
/usr/local/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h:31:0,
from ext_modules/src/util/cpp/triangle_mesh.cpp:16:
/usr/local/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h:201:14:
note: candidate: template<class VertexUVmap, class VertexIndexMap, class
VertexParameterizedMap> CGAL::Surface_mesh_parameterization::Error_code
CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3<TriangleMesh_,
BorderParameterizer_,
SolverTraits_>::parameterize(CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3<TriangleMesh_,
BorderParameterizer_, SolverTraits_>::TriangleMesh&,
CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3<TriangleMesh_,
BorderParameterizer_, SolverTraits_>::halfedge_descriptor, VertexUVmap,
VertexIndexMap, VertexParameterizedMap) [with VertexUVmap = VertexUVmap;
VertexIndexMap = VertexIndexMap; VertexParameterizedMap =
VertexParameterizedMap; TriangleMesh_ =
CGAL::Seam_mesh<CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > >; BorderParameterizer_ =
CGAL::Surface_mesh_parameterization::Square_border_uniform_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > > >; SolverTraits_ =
CGAL::Eigen_solver_traits<Eigen::BiCGSTAB&lt;Eigen::SparseMatrix&lt;double,
0, int>, Eigen::IncompleteLUT<double> > >]
Error_code parameterize(TriangleMesh& mesh,
^~~~~~~~~~~~
/usr/local/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h:201:14:
note: template argument deduction/substitution failed:
In file included from ext_modules/src/util/cpp/triangle_mesh.cpp:18:0:
/usr/local/include/CGAL/Surface_mesh_parameterization/parameterize.h:96:62:
note: cannot convert ‘mesh’ (type
‘CGAL::Surface_mesh<CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double> > >’)
to type
‘CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > >,
CGAL::Surface_mesh_parameterization::Square_border_uniform_parameterizer_3<CGAL::Seam_mesh&lt;CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > > >,
CGAL::Eigen_solver_traits<Eigen::BiCGSTAB&lt;Eigen::SparseMatrix&lt;double,
0, int>, Eigen::IncompleteLUT<double> > > >::TriangleMesh& {aka
CGAL::Seam_mesh<CGAL::Surface_mesh&lt;CGAL::Point_3&lt;CGAL::Simple_cartesian&lt;double>
> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Edge_index,
bool> >,
boost::associative_property_map<CGAL::Unique_hash_map&lt;CGAL::SM_Vertex_index,
bool> > >&}’
return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm);



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page