Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] 3D natural neighbours

Subject: CGAL users discussion list

List archive

[cgal-discuss] 3D natural neighbours


Chronological Thread 
  • From: D Haley <>
  • To:
  • Subject: [cgal-discuss] 3D natural neighbours
  • Date: Tue, 13 Jul 2010 08:12:44 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qrYwI0Ao+bgzevGeb1w+YI2Mk6OVzH2rozMH4cIEkFzWV39WDAT7uBoGotEdiMJB5o7TzzE14xf8EiNfeIJfhT7ufj+8dLd+QAZT32PoKur8mnCP86/CoihMB7w2ft4RfYdGCMd5azOJ52nTbM2MCcsPC6E+uaGA/ms5cmAfwMo=;

Hello,

I am having some problems with the CGAL natural neighbour interpolation
routines, which I am trying to use to compute a scalar field from an
unstructured point dataset.

I have this working in 2D, as adapted from the documentation, however I would
like to perform this computation in 3D. My usage of the delaunay
triangulation compiles in 3D, but the natural neighbour computation does not.

I have the following code, which is wrong, but there is no documentation (as
far as I can see...) and working from the header
(natural_neighbour_coordinates_3.h) files is proving tricky, as it appears
there is a different interface. Indeed, I can't seem to get the data types
and calling sequence right!

If anyone can provide a working snippet (even for only a few points), then I
can get the data structures right, and this would be very helpful!

Eventually I would like to extend this to 3D gradient fitting; but may not
be doing things correctly at the moment...

Thanks.
====
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>

#include <CGAL/natural_neighbor_coordinates_3.h>
#include <CGAL/Interpolation_traits_2.h>

#include <CGAL/interpolation_functions.h>

#include <CGAL/ch_graham_andrew.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_3<K> DelaunayTriangulation;

bool interpolateNaturalN(const DelaunayTriangulation &dTriangles,
std::map<K::Point_3, K::FT, K::Less_xyz_3> &scalarMap, K::Point_3 p, float
&res)
{
typedef CGAL::Data_access< std::map<K::Point_3, K::FT, K::Less_xyz_3>
> value_access;
typedef std::vector< std::pair< K::Point_3, K::FT > >
Point_coordinate_vector;


K::FT norm;
Point_coordinate_vector coords;
CGAL::Triple<std::back_insert_iterator<Point_coordinate_vector>,
K::FT, bool>
result=laplace_natural_neighbor_coordinates_3(dTriangles,p,std::back_inserter(coords),norm);

}

====

The above code gives me GCC errors like :

/usr/include/c++/4.4/bits/stl_pair.h: In constructor ‘std::pair<_T1,
_T2>::pair(const std::pair<_U1, _U2>&) [with _U1 =
CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>,
CGAL::Triangulation_ds_vertex_base_3<CGAL::Triangulation_data_structure_3<CGAL::Triangulation_vertex_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>, CGAL::Triangulation_ds_vertex_base_3<void> >,
CGAL::Triangulation_cell_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>, CGAL::Triangulation_ds_cell_base_3<void> > > > >,
CGAL::Default_argument>, false>, _U2 = double, _T1 =
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >, _T2 =
double]’:
/usr/include/CGAL/natural_neighbor_coordinates_3.h:100: instantiated from
‘CGAL::Triple<OutputIterator, typename Dt::Geom_traits::FT, bool>
CGAL::laplace_natural_neighbor_coordinates_3(const Dt&, const typename
Dt::Geom_traits::Point_3&, OutputIterator, typename Dt::Geom_traits::FT&,
typename Dt::Cell_handle) [with Dt =
CGAL::Delaunay_triangulation_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>,
CGAL::Triangulation_data_structure_3<CGAL::Triangulation_vertex_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>, CGAL::Triangulation_ds_vertex_base_3<void> >,
CGAL::Triangulation_cell_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>, CGAL::Triangulation_ds_cell_base_3<void> > > >, OutputIterator =
std::back_insert_iterator<std::vector<std::pair<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >, double>,
std::allocator<std::pair<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >,
double> > > >]’
main.cpp:207: instantiated from here
/usr/include/c++/4.4/bits/stl_pair.h:101: error: no matching function for
call to ‘CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >
>::Point_3(const
CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>,
CGAL::Triangulation_ds_vertex_base_3<CGAL::Triangulation_data_structure_3<CGAL::Triangulation_vertex_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>, CGAL::Triangulation_ds_vertex_base_3<void> >,
CGAL::Triangulation_cell_base_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
>, CGAL::Triangulation_ds_cell_base_3<void> > > > >,
CGAL::Default_argument>, false>&)’
/usr/include/CGAL/Point_3.h:83: note: candidates are:
CGAL::Point_3<R_>::Point_3(const typename R_::RT&, const typename R_::RT&,
const typename R_::RT&, const typename R_::RT&) [with R_ =
CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >]
/usr/include/CGAL/Point_3.h:75: note:
CGAL::Point_3<R_>::Point_3(const typename R_::Kernel_base::Point_3&) [with R_
= CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >]
/usr/include/CGAL/Point_3.h:71: note:
CGAL::Point_3<R_>::Point_3(const CGAL::Origin&) [with R_ =
CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >]
/usr/include/CGAL/Point_3.h:69: note:
CGAL::Point_3<R_>::Point_3() [with R_ =
CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >]
/usr/include/CGAL/Point_3.h:40: note:
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >
>::Point_3(const
CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >&)






Archive powered by MHonArc 2.6.16.

Top of Page