Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3809682
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:20:35+00:00 2026-05-19T15:20:35+00:00

I’m having quite some difficulty getting a vertex_handle for each of the end points

  • 0

I’m having quite some difficulty getting a vertex_handle for each of the end points of an edge in a Delaunay triangulation. Since I hammered my head against this for several hours I thought maybe one of you guys could help me out with this apparently trivial problem:

#include <iostream>

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>

using namespace std;

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_2<K> Triangulation;
typedef Triangulation::Point Point;
typedef Triangulation::Edge_iterator Edge_iterator;
typedef Triangulation::Vertex_handle Vertex;

int main(){
  Point p;
  Triangulation t;
  while(cin >> p)
    t.insert(p);

  // Iterate over edges
  for(Edge_iterator ei=t.finite_edges_begin();ei!=t.finite_edges_end(); ei++){
    // Get a vertex from the edge
    Vertex vs = ei->source();
  }
}

According to the documentation dereferencing an Edge_iterator I should get an Edge_handle and Edge_handle should have members source() and target() to simply get the endpoints, but it won’t compile and seems to be wrong. Derefencing like above will give me a pair<> which doesn’t have those member functions.

Any idea what I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:20:36+00:00Added an answer on May 19, 2026 at 3:20 pm

    Dereferencing an Edge_iterator will give you an Edge according to the documentation.

    Edge is definded as follows: typedef std::pair<Face_handle,int> Edge;

    Dereferencing the Face_handle will give you a Face.

    The two vertices that the edge joins can be accessed by:

      for(Edge_iterator ei=t.finite_edges_begin();ei!=t.finite_edges_end(); ei++){
        // Get a vertex from the edge
        Triangulation::Face& f = *(ei->first);
        int i = ei->second;
        Vertex vs = f.vertex(f.cw(i));
        Vertex vt = f.vertex(f.ccw(i));
      }
    

    I don’t know if it is helpful for you quest, but is access the points like this:

    for (Edge_iterator it = m_tri.edges_begin(); it != m_tri.edges_end(); ++it)
    {
        Triangulation::Segment seg = m_tri.segment( *it );
    
        Triangulation::Point p0 = seg.point(0);
        Triangulation::Point p1 = seg.point(1);
        // ...
    }
    

    The CGAL documentation is confusing to me… I am curious where you found the eh->source() and eh->target() calls, I could not find it 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.