How to get adjacent vertices in 3d triangulation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get adjacent vertices in 3d triangulation

GAD FLY
Hi all,

Can anybody help me to use the adjacent_vertices() function in 3d triangulation adjacent_vertices() with a simple example?

Thanks,
James
Reply | Threaded
Open this post in threaded view
|

Re: How to get adjacent vertices in 3d triangulation

MaelRL

Hello,

A good idea when wondering how to actually use a function of CGAL that you have found in the doc is to search the code of CGAL for real usages of that function (either grepping the source, or using the search function on github).

For example, https://github.com/CGAL/cgal/search?p=1&q=adjacent_vertices&unscoped_q=adjacent_vertices here is the result of the search, and you can find this piece of code, which illustrates a call to adjacent_vertices with a 3D periodic triangulation: you create a container (here a vector) and pass as parameters both the vertex whose adjacent vertices you want to collect, and an inserter to the container (here using std::back_inserter() to create such inserter).

Your container is then filled by the function with the adjacent vertices of the vertex passed as a parameter and you can use them as you desire afterwards.

Does this clarify things for you?

Best,
Mael

On 2018-11-01 17:25, GAD FLY wrote:
Hi all,

Can anybody help me to use the adjacent_vertices() function in 3d triangulation adjacent_vertices() with a simple example?

Thanks,
James

Reply | Threaded
Open this post in threaded view
|

Re: How to get adjacent vertices in 3d triangulation

GAD FLY
Thanks Mael,
This solved my problem!

--
James,


On Thursday, November 1, 2018 12:53 PM, Mael <[hidden email]> wrote:


Hello,
A good idea when wondering how to actually use a function of CGAL that you have found in the doc is to search the code of CGAL for real usages of that function (either grepping the source, or using the search function on github).
For example, https://github.com/CGAL/cgal/search?p=1&q=adjacent_vertices&unscoped_q=adjacent_vertices here is the result of the search, and you can find this piece of code, which illustrates a call to adjacent_vertices with a 3D periodic triangulation: you create a container (here a vector) and pass as parameters both the vertex whose adjacent vertices you want to collect, and an inserter to the container (here using std::back_inserter() to create such inserter).
Your container is then filled by the function with the adjacent vertices of the vertex passed as a parameter and you can use them as you desire afterwards.
Does this clarify things for you?
Best,
Mael
On 2018-11-01 17:25, GAD FLY wrote:
Hi all,

Can anybody help me to use the adjacent_vertices() function in 3d triangulation adjacent_vertices() with a simple example?

Thanks,
James