Subject: CGAL users discussion list
List archive
- From: Efi Fogel <>
- To:
- Subject: Re: [cgal-discuss] Duplicate points in Arrangment
- Date: Sun, 5 Feb 2012 17:48:33 +0200
See my answer inline.
On Sun, Feb 5, 2012 at 4:49 PM, Winnie Hellmann <> wrote:
Yes, yours. arr.insert_in_face_interior(x) can be used under the severe restriction that x does not intersect with an existing feature.
If you are in doubt, use CGAL::insert_point(p).
If you need to know whether p collides with an existing vertex or lie on an existing curve, locate p beforehand using some point-location strategy.
> In an arrangement you cannot have more than one feature with the sameWell, that's what I thought. But for the following code...
> geometric embeddings. For example, a given point is associated with at most
> one vertex.
std::cout << arrangement.number_of_vertices() << std::endl;
arrangement.insert_in_face_interior(CGAL::Point_2<Kernel>(1, 10),
arrangement.unbounded_face());
std::cout << arrangement.number_of_vertices() << std::endl;
arrangement.insert_in_face_interior(CGAL::Point_2<Kernel>(1, 10),
arrangement.unbounded_face());
std::cout << arrangement.number_of_vertices() << std::endl;
... I get 0, 1, and 2 as output. So there seem to be two vertices at (1,
10). Is this a bug?
Yes, yours. arr.insert_in_face_interior(x) can be used under the severe restriction that x does not intersect with an existing feature.
If you are in doubt, use CGAL::insert_point(p).
If you need to know whether p collides with an existing vertex or lie on an existing curve, locate p beforehand using some point-location strategy.
I tested the code with following definitions:
#include <CGAL/Arr_linear_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h>
struct FaceData
{
...
};
typedef CGAL::Gmpq Number;
typedef CGAL::Cartesian<Number> Kernel;
typedef CGAL::Arr_linear_traits_2<Kernel> Traits_2;
typedef CGAL::Arr_face_extended_dcel<Traits_2, FaceData> Dcel;
typedef CGAL::Arrangement_2<Traits_2, Dcel> Arrangement_2;
Arrangement_2 arrangement;
That was my question: How do I find out that there is already a vertex
> Using an Observer you can intercept all attempts to insert a point or a
> curve into an arrangement that has already a feature (i.e., a vertex or an
> edge) associated with the point or curve.
with the same coordinates? (without checking all the vertices)
- [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/04/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Juan Carlos Lopez Alfonso, 02/04/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Efi Fogel, 02/04/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Efi Fogel, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Efi Fogel, 02/05/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Winnie Hellmann, 02/05/2012
- [cgal-discuss] Re: Duplicate points in Arrangment, Winnie Hellmann, 02/06/2012
- Re: [cgal-discuss] Duplicate points in Arrangment, Juan Carlos Lopez Alfonso, 02/04/2012
Archive powered by MHonArc 2.6.16.