Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Add information in Triangulation while inserting a range of points
Chronological Thread
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] Add information in Triangulation while inserting a range of points
- Date: Mon, 13 May 2019 10:10:35 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:MJaHBxWfCHEN8g2bF8OcgFfVLuLV8LGtZVwlr6E/grcLSJyIuqrYbRCFt8tkgFKBZ4jH8fUM07OQ7/m5Hz1bqs/b6zgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrsAndrM0bjIVtJqos1BfErGZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklDsLOjgk+2zRl8d+jr9UoAi5qhJi3YDUboGbOvlwcKzTctwVR3ZOU91LWCBdGI6xdZcDAuQDMOtesoLzp0EOrRy7BQS0GO7vzCJHhmXo0qIgyOQqDAHI0xY7ENIUsXTfsdL4O70UUe+o1qnH0y/Mb+hM1Tfz8ofHaQohofCXULJ/b8XRzkwvGB3ZjlWKqY3lMSma2fgRs2ic9ephVfijhHIgqwF0uzWiwNonhIfOhoIQ0F/E9CN5zZ4zJdKiU0F0etqkH4VKuy6GMIt2R9suQ2BuuCYgy70Jo4S3fCYQyJg/2xHfZOaIc4yS7hLkTuaRLjF1j29mdrKnnxu+7Eqtx+7mWsS63ltGtDRJn9nRunwXyhDe7tCLR/9h8ku72juC1hrf5vxALE0wj6bXNpAsz7A2m5EOq0rMBDX2l1/zjKKOdkUr5Oyo6+P/b7n7qZKQLYp0igb8P6g0n8ywG+U4MgwXU2ic5OS8yKfv/UrnQLVKlPE2lLfWsIzCKcQaoK62HRNV354+5xu9DDqqytoVkHcdIF5beB+LkpLlN0zKLfzgCPewmVWskDNlx/DcOb3hB43AIWLFkLj8Z7Zy9VRTyBEpwdBR/Z1bEasBIPPoV0/+qtPYCRo5PBKow+b9CNR92JkRVn6TAq+eKqPTsUWE6f4oI+mJfIMVoiryK+A55/7yin80gUMSfaaz0psTcXy3A/VmI16FbnrxmdcBCnwHvhE+TezvkF2NSyRfZ3e0X6Im5zE0EpiqDYnZRtPlvbqawS3uHoFKfnsUTReXAHLwfsOFXe0NYWScOIh6gzkcXP+gTYEmkhqhvQu/x7t8JffP4X4kssfo29FxouHSjhov7idcDsKH0mjLQXsnsHkPQmof2qxlrEVmgnmK27J5y6hRE9BJ6vpSFAkzP4Td5+N3DNX/RhjQcN6CVFG8U5OtBjRnHYF5+MMHf0soQ4bqtRvExSf/W+ZJxYzOP4Q99+fn51a0P9x0kS+U26QmilQ6WNpBPGa6gbRusQPUAtyRyhjLp+ORba0ZmRX12iKDwG6J5hwKCVI2VKKaG3UWZ0+TqsnloETcT/moBKh1alIQm/7HEbNDb5jStXsDQf7iPNrEZGfrwjW/CBGNy6+WfYTjcHkaxjSbA08BwVge
We could add an insertion of a range to the Triangulation_3
class, but then no andreas
On 5/13/2019 9:01 AM, Marc Alexa wrote:
Yes, CGAL is sometimes mysterious in what types are accepted by
what functions. I agree you’d expect that the insert method for
Triangulation_3 should be able to understand how to handle the
pairs if Delaunay_triangulation_3 does. But, no. If you insist on
using the pairs and are ok with initially getting a Delaunay
triangulation, the following code works just fine:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_3.h>
#include <CGAL/Delaunay_Triangulation_3.h>
#include <CGAL/Triangulation_cell_base_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <vector>
typedef
CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef
CGAL::Triangulation_vertex_base_with_info_3<unsigned,
K> Vb;
typedef
CGAL::Triangulation_cell_base_3<K> Cb;
typedef
CGAL::Triangulation_data_structure_3<Vb, Cb>
Tds;
//Use
the Fast_location tag. Default or Compact_location works
too.
typedef CGAL::Triangulation_3<K,
Tds> Triangulation;
typedef
CGAL::Delaunay_triangulation_3<K, Tds> DT;
typedef Triangulation::Point
Point;
int main()
{
std::vector<
std::pair<Point, unsigned> > points;
points.push_back(std::make_pair(Point(0, 0, 0), 0));
points.push_back(std::make_pair(Point(1, 0, 0), 1));
points.push_back(std::make_pair(Point(0, 1, 0), 2));
points.push_back(std::make_pair(Point(0, 0, 1), 3));
points.push_back(std::make_pair(Point(2, 2, 2), 4));
points.push_back(std::make_pair(Point(-1, 0, 1), 5));
Triangulation T = DT(points.begin(), points.end()); CGAL_assertion(T.number_of_vertices() == 6); return 0; } I believe speed-wise there is very little to be gained from not using Delaunay. If you don’t care about what coordinate in space carries which number, you could insert the range of points first and then set the info later. In this case, however, the order of the points you get form the vertex iterator will likely differ from the order in which you provided the points. -Marc
-- Andreas Fabri, PhD Chief Officer, GeometryFactory Editor, The CGAL Project phone: +33.492.954.912 skype: andreas.fabri |
- [cgal-discuss] Add information in Triangulation while inserting a range of points, sanlingtonCGAL, 05/13/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Mael, 05/13/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Marc Alexa, 05/13/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Andreas Fabri, 05/13/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Andreas Fabri, 05/13/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Marc Alexa, 05/15/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Mael, 05/15/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Laurent Rineau (CGAL/GeometryFactory), 05/15/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Mael, 05/15/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Marc Alexa, 05/15/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Andreas Fabri, 05/13/2019
- Re: [cgal-discuss] Add information in Triangulation while inserting a range of points, Andreas Fabri, 05/13/2019
Archive powered by MHonArc 2.6.18.