Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Mael <>
  • To:
  • Subject: Re: [cgal-discuss] Parameterizing a Seam_mesh with a fixed border and mean value coordinates
  • Date: Thu, 10 Oct 2019 08:50:04 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:Wt3V/hyFDH5ZkOnXCy+O+j09IxM/srCxBDY+r6Qd2+4QIJqq85mqBkHD//Il1AaPAdyArawewLOP6OjJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVijexe7J/IAu5oQnMq8Ubj5ZpJ7osxBfOvnZGYfldy3lyJVKUkRb858Ow84Bm/i9Npf8v9NNOXLvjcaggQrNWEDopM2Yu5M32rhbDVheA5mEdUmoNjBVFBRXO4QzgUZfwtiv6sfd92DWfMMbrQ704RSiu4qF2QxLulSwJNSM28HvPh8JtkqxbrhKvqR9xzYHab46aNuZxcKzGcNMGRmdMRNpdWzBPD46+aYYEEuoPPfxfr4n4v1YAqgGxCheoBOjyzTJIg2X50rM+0+g7CwHG2xEgHt0Qv3TQttn1ML0dXvuuw6bW1jjDYO1Z2TD46IfWbhAhu/GNXbxqfsXN1UkvEBnFj1WKpYP5ODOV0/0Avm6G5ORuUuKvjnQoqwB3ojW3wMcjkJLGiZkRyl/a7yl23IE1Jdi+RUVmYtCkCINduzyYOoZ1WM8vTX9ktDw+x7AHo5K3YTQGxIo/yxLBcfCLboiF7gj+WOueIzp0nmxpdK67ihu07EOu0PfzVtOu31ZPtidFksfDtnQK1xHL98SLVuFx/kKm2TqSzQzT7/tLIUEwlabCLJ4h36IwmoAUsUTdHi/6gkP2g7GKdkk8++io7froYqn+q5OBNYJ5iRvyP6owlsClBek1MxICU3WH9eiizLHj+Ff2QLROjv04iKnZt5XaKNwepqGjHQBV1pwv6wy4Dze739UXg30HIEhBeB2dlIfmIE/BLev3DfihhFSslSlkx+zcPrzhDJXCNGTMkKvmfbZn609Q0hY8zdda555MELEOPOrzWlPttNzfFhI2LwO0zPzjCNlky4weWHmPDbOEMKPJql+F/fkvIumJZI8NojnxMfkl5/j0jX84g1ARZ6ep3YFEIEy/S/9pKkHcbXv3icoaCk8LuBA/Rarkkg6sSzlWMlO7UqZ0sjQyBYbgF4DeVo2pxriI1i22NpJbYWVLFkqdH37ja4KeSrEHbyfEcZwpqSANSbX0E9xp7hqprgKvk+M6fNqRwTURsNfY7PYw5+DXkktvp2UsScGaiieIRmBw22QVW3kxwqA5p0FhmA/ajfpIxsdAHNkW3MtnFx8gPMSFneN3DNX/RhjQcN6CVFG8U5OtBjRjFotgke9LWF50HpCZtj6G2iOrB7EPkLnRXc47/6XZ0mTrNsh0wGrBzrhnhF4jEJNC

Hello,

You're passing "sm" to your parameterizer instead of seam_mesh.

There is no need to look at all the template parameters, look at the error directly and your compiler says it:

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>

Best,
Mael

On 09/10/2019 21:43, meder411 wrote:
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