Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Alpha Shape 2D

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Alpha Shape 2D


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Alpha Shape 2D
  • Date: Sun, 05 Oct 2008 20:08:33 +0200

Andreas Fabri wrote:

Hi Juan Pablo,

Juan Pablo Carbajal wrote:
Andreas,
Yes, I have read the documentation.
The problem is - sorry for my newbiness - that I thought that with
those iterators I could do as follow

typedef CGAL::Alpha_shape_2<Delaunay> Alpha_shape;

Alpha_shape::Alpha_shape_vertices_iterator it = A.alpha_shape_vertices_begin();

x = (*it).point().x();
y = (*it).point().y();

where A is an Alpha_shape_2 created from a list of Point_2.

This doesn't compile. The error says that it has no member "point".



You have to write "->point()" and not ".point()".
I admit that this is more our mistake than yours. The value_type of
the Alpha_shape_vertices_iterator; is Vertex_handle. I didn't find that
in the manual, but in the code.

typedef typename std::list< Vertex_handle >::iterator Alpha_shape_vertices_iterator;

So it should be changed or documented.

I have to correct myself. It is documented, as it says
Alpha_shape_2<Dt>::Alpha_shape_vertices_iterator
A bidirectional and non-mutable iterator that allow to traverse the
vertices
which belongs to the -shape for the current .
Precondition: Its value_type is Dt::Vertex_handle

It is nevertheless surprising.

andreas



I was trying to read more on Vertex_handle but I cannot find
documentation and the header file is a little too much for my C++
level.

Admittedly the documentation of the Vertex is "hidden".
An Alpha Shape derives from Delaunay_triangulation_2, derives from Triangulation_2
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_2.html#Cross_link_anchor_944
where you find

"The second parameter is the triangulation data structure, it has to be instantiated
by a model of the concept TriangulationDataStructure_2"

When you click on TriangulationDataStructure_2 you find

"The concept can be seen as a container for the faces and vertices of the triangulation.
The concept TriangulationDataStructure_2 includes two sub-concepts
TriangulationDataStructure_2::Vertex and TriangulationDataStructure_2::Face."

and here we are
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TDS_2_ref/Concept_TriangulationDataStructure_2--Vertex.html#Cross_link_anchor_959



best regards,

andreas


Thanks again,

JPi


On Sun, Oct 5, 2008 at 2:07 PM, Andreas Fabri
<>
wrote:
Juan Pablo Carbajal wrote:
Dear all,
I am new to CGAL and I am trying to obtain the 2D alpha shape of a set
of points (in the plane, of course).
Everything is working ok but I just cannot figure out how to get the
list of vertices of the boundary of the alpha shape.
I have checked the discussions about alpha shapes boundaries in the
archive of the list but I could not find the solution there.
Is there something like
Alpha_shape_3::get_alpha_shape_vertices
for Alpha_shape_2?

Thanks

JPi
Hi Juan Pablo,

There is no iterator that allows you to follow the border, if that
is what you are looking for.

However, the alpha shape class provides iterators for enumerating
the vertices and edges

http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Alpha_shapes_2_ref/Class_Alpha_shape_2.html#Cross_link_anchor_995

best regards,

andreas
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss









Archive powered by MHonArc 2.6.16.

Top of Page