Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Suggestions for how to do 2D nearest neighbour search from 3D points?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Suggestions for how to do 2D nearest neighbour search from 3D points?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Suggestions for how to do 2D nearest neighbour search from 3D points?
  • Date: Tue, 30 Apr 2013 16:55:57 +0200
  • Organization: GeometryFactory

On 04/30/2013 04:31 PM, Matti Lehtonen wrote:
Hi,

On 30 April 2013 14:58, Sebastien Loriot (GeometryFactory)
<

<mailto:>>
wrote:

I think you should simply use:


struct Property_map_xy_2
{
typedef Point_2 value_type;
typedef value_type reference;

typedef const Multi_Classified_Point & key_type;
typedef boost::readable_property_map___tag category;
};


with


Property_map_xy_2::reference
get
(
Property_map_xy_2,
Property_map_xy_2::key_type p
)
{
return Point_2( p.x(), p.y() );
}


Without reference at "typedef value_type reference", but still with
const keyword, a core dump is created, while building the tree.

terminate called after throwing an instance of
'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: b = (b && (bbox.min_coord(i) <= tbox.min_coord(i)))
File: /usr/include/CGAL/Point_container.h
Line: 325



otherwise, you might use tmp while it was changed.


I used a const reference, so changing should not be possible.
It's not you who change it but each call to get(pmap,key). You must
remove this static variable.

If it still does not work please provide a minimal example showing the
pb, I'm quite sure there is no pb with the implementation.

Sebastien.





It seems that a tuple version works - inefficiently and with ugly code,
but it works.


To the wish list:
* e.g. CGAL::Distance_xy_3 could be used similarly like
CGAL::Triangulation_euclidean_traits_xy_3, which allows use of 3D points
for 2D triangulation


Matti L
--
Life is complex. It has real and imaginary parts.




Archive powered by MHonArc 2.6.18.

Top of Page