Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] CGAL 4.11.1 : Create convex hull - compilation errors
- Date: Mon, 5 Mar 2018 11:24:13 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:Ym4irhCntJztmRNaH7HUUyQJP3N1i/DPJgcQr6AfoPdwSPT9rsbcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKiA38G/XhMJzgqxUrh2uqB5jzIDbe4yVKPlzc7nBcd8GS2dMXsBcXDFBDIOmaIsPCvIMMehFoYbjvFQBtwC+BRWtBOzxzD9Dm3n43aog0+QgFgHGwBErE9YPvnvKq9X1MbkdUfyvzKjIzTvMde9Z2Sv66IjSchEtpP+AVq93fMrKzUkvEBnFjlSXqYz5JT+V0+ANvnOU7+plT+2vimonpxttrTiow8chk4/EjZ8bxFDD8CV22oc1JdugRUFnbt6rCp9QuzudN4tsTcMuW31ntzg8yr0HpZ63ZjQFyJMixxPZdveJcJCI7wr9WOqNJTp0nnFodbKlixqv70StyffwWtS23VtEtiZIkNrBumoT2xHc68WLUOZx80Ov1DqV1Q3e6udJKl0um6XBMZ4u2Lswm4ITsUvdGi/2n137jKqMeUUl/uik8urmYq/6qpOFOY94lwPzP6o0lsywBuQ4NQcOX2yF9uimyLLj+kj5TK1Ljv0wjKbZrIjXKdoHqqO9GQNY0YYu5wyiAzu409kUh2QLIVBLdR6fiojmIVDOIPT2DfelhFSslS9mx+vCPr3mGJXNL3/DkKv7cbZ4705R0wUzzdVF6JJVDrENOu78Wkj0tNDAFB82LxS0w/r7CNV6zo4RRW2PDbWdMK/LrFCI5/kvLPWRZI8OozbwMOMl5v7rjX8hg1ARZ6ip3Z0NaHC5BPtqOUuZYWC/yusGRGwFtw57QO3xg0CZShZSYWyzVuQy/GIVEoWjWM34S4qkm6CA0SHzOppMZ2daQhCjHHDtepmeStkFYz6VON4g2HRQTrymUY4myVersCf1zrNmKqzf/ShO5sGr78R8++CGzUJ6zjdzFcnIizjcHVExpXsBQnoN5I46pEV8zlmZ1q0h2q5XENVS47VCVQJobMeAndw/MMj7X0f6RvnMUEyvG4z0DjQ4T9Z3yNgLMR4kRoeSyyvb1i/vOIc70ryGAJturPDZ1nn1YtlnkzPIjfZ6yVYhRcRLOCutgastrwU=
The following is working for me:
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <boost/iterator/transform_iterator.hpp>
#include <CGAL/convex_hull_3.h>
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Surface_mesh<K::Point_3> Mesh;
typedef Mesh::Property_map<Mesh::Vertex_index, K::Point_3> Vpm;
int main()
{
Mesh m1, m2;
CGAL::convex_hull_3(
boost::make_transform_iterator(m1.vertices().begin(),
CGAL::Property_map_to_unary_function<Vpm>(m1.points())),
boost::make_transform_iterator(m1.vertices().end(),
CGAL::Property_map_to_unary_function<Vpm>(m1.points())),
m2);
}
Side note: you should use exact predicates with the convex hull
algorithm.
Sebastien.
On 03/05/2018 11:05 AM, Riedel, Torge wrote:
Hi,
I tried to compute a convex hull of a mesh, but I get compilation errors and do not know how to fix. Here is my code:
typedefCGAL::Simple_cartesian<double> K;
typedefCGAL::Surface_mesh<K::Point_3> Mesh;
std::vector< CGAL::cpp11::array<double, 3> > points;
std::vector< CGAL::cpp11::array<int, 3> > triangles;
CGAL::read_STL(input, points, triangles);
CGAL::Polygon_mesh_processing::orient_polygon_soup(points, triangles);
Meshm;
CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, triangles, m);
Meshsm_convex;
CGAL::convex_hull_3(m.vertices_begin(), m.vertices_end(), sm_convex);
std::cout <<" i Points: "<<sm_convex.number_of_vertices() <<" Triangles: "<<sm_convex.number_of_faces() <<std::endl;
I get the following compilation errors:
1>C:\Evaluation\MeshFW\cgal.org\CGAL-4.11.1\include\CGAL/convex_hull_3.h(903): error C2976: 'CGAL::internal::Convex_hull_3::Default_traits_for_Chull_3': too few template arguments
1> C:\Evaluation\MeshFW\cgal.org\CGAL-4.11.1\include\CGAL/convex_hull_3.h(72): note: see declaration of 'CGAL::internal::Convex_hull_3::Default_traits_for_Chull_3'
1> main.cpp(114): note: see reference to function template instantiation 'void CGAL::convex_hull_3<CGAL::Surface_mesh<CGAL::Point_3<Kernel_>>::Index_iterator<CGAL::Surface_mesh<CGAL::Point_3<Kernel_>>::Vertex_index>,Mesh>(InputIterator,InputIterator,Polyhedron_3 &)' being compiled
1> with
1> [
1> Kernel_=CGAL::Epick,
1> InputIterator=CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick>>::Index_iterator<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick>>::Vertex_index>,
1> Polyhedron_3=Mesh
1> ]
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(54): note: see reference to class template instantiation 'boost::arg<9>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(53): note: see reference to class template instantiation 'boost::arg<8>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(52): note: see reference to class template instantiation 'boost::arg<7>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(51): note: see reference to class template instantiation 'boost::arg<6>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(50): note: see reference to class template instantiation 'boost::arg<5>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(49): note: see reference to class template instantiation 'boost::arg<4>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(48): note: see reference to class template instantiation 'boost::arg<3>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(47): note: see reference to class template instantiation 'boost::arg<2>' being compiled
1> C:\Evaluation\MeshFW\cgal.org\boost_1_66_0\boost/bind/placeholders.hpp(46): note: see reference to class template instantiation 'boost::arg<1>' being compiled
1>C:\ Evaluation\MeshFW\cgal.org\CGAL-4.11.1\include\CGAL/convex_hull_3.h(903): error C2955: 'CGAL::internal::Convex_hull_3::Default_traits_for_Chull_3': use of class template requires template argument list
1> C:\Evaluation\MeshFW\cgal.org\CGAL-4.11.1\include\CGAL/convex_hull_3.h(72): note: see declaration of 'CGAL::internal::Convex_hull_3::Default_traits_for_Chull_3'
In my understanding this is because I passed the vertex iterators to the convex hull function. If I pass iterators of an std::vector of points like the example in the cgal docs does it, it compiles without problems. I was not able to find a way to get iterators to the points of a surface mesh. My challenge is, that the mesh “m” has to be the input source for the complex hull operation. A separate list/vector of the points is not available. So my question is: How to do this? Hopefully without the need to build an extra list of points.
Kind regards
Torge
CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt
Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt, Andreas Karrer
Bankverbindungen:
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht: Amtsgericht Stuttgart
Handelsregister: HRB Nr. 19117
Umsatzsteuer: ID-Nr. DE 147 862 777
- [cgal-discuss] CGAL 4.11.1 : Create convex hull - compilation errors, Riedel, Torge, 03/05/2018
- Re: [cgal-discuss] CGAL 4.11.1 : Create convex hull - compilation errors, Sebastien Loriot (GeometryFactory), 03/05/2018
- AW: [cgal-discuss] CGAL 4.11.1 : Create convex hull - compilation errors, Riedel, Torge, 03/05/2018
- Re: [cgal-discuss] CGAL 4.11.1 : Create convex hull - compilation errors, Sebastien Loriot (GeometryFactory), 03/05/2018
Archive powered by MHonArc 2.6.18.