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 8991967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:50:53+00:00 2026-06-15T22:50:53+00:00

I want to accumulate the edges of triangular model/mesh. For example a triangular cube

  • 0

I want to accumulate the edges of triangular model/mesh. For example a triangular cube has 18 edges.

It looks so simple and easy but literally its too complicated.
I have all adjacent information of a triangle. For example I have adjacent vertices and triangles, and I know which triangles have common edge but the problem is how to extract that common edge between two triangles.

One thing that needs to consider is there should not be any duplicate index of edge’s point/vertex.

First thing is how to count the total number of edges. Remember a Cube has 18 edges.

I tried a lot but gave up now. 🙂
any idea?
.

Update 1:

ok I have a triangle T[i] (index v1, index v2, index v3) which has three edges v1v2, v2v3, v3v1.

and I have a neighbor triangles of all edges.

T[i].index_of_sharedTri1_with_edge_v1v2, 
T[i].index_of_sharedTri2_with_edge_v2v3, 
T[i].index_of_sharedTri3_with_edge_v3v1; 

now which loop I need to make that can extract unique edge? What information I need to compare? Do I need to compare edge vertices, shared tri index, or what ? I tried with many ways but it so complicated.

Update 2:

GLTris *e = new GLTris[nb_Tris*3];
int n = getTotalEdges_Sorted(indices, nb_Tris, e);
cout<<n<<endl;
int ne = RemoveDublicatesFromAnSortedEdgeArray(e, n);
for(int i=0; i<ne; i++)
   e[i].Cout();

I have tried this and it works perfect but I need to figure it out whether it will work on all types of meshes and is it a efficient way?

  • 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-06-15T22:50:54+00:00Added an answer on June 15, 2026 at 10:50 pm

    If you have the number of triangles, and the adjacency information for each, then the number of edges is simply:

    3 * num_triangles – num_shared_edges

    Where num_shared_edges can be accumulated by iterating over each triangle and adding up the number of adjacent triangles. Then divide by two, as you’ll have counted them all twice (this obviously assumes you have no more than two triangles per edge)

    If you want to build a list of unique edges, you’ll need to keep track of them, preferably in some easily indexable structure like a map.

    The procedure is roughly as follows:

    1. Define an edge as being two indices (i1, i2). Order those indices such that i1 < i2. Now shared edges are guaranteed to match.
    2. Make some kind of list structure that can hold these edges. You need to be able to quickly find an existing edge by its indices, so you want a structure that is searchable, such as some kind of tree. If you were using c++, I’d suggest using a map with the i1,i2 pair as a key.
    3. Iterate over all triangles, adding 3 edges for each. Do not add the edge if it already exists.

    That’s all there is to it.

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

Sidebar

Related Questions

I want to generate a report to accumulate the total stock quantity that has
Want to run javascript function from parent window in child window Example I have
Want the function to sort the table by HP but if duplicate HPs then
want to ask user to input something but not want to wait forever. There
I have a matrix I , and I want to accumulate in an array
I want to know why std::accumulate (aka reduce) 3rd parameter is needed. For those
we want to use gerrit for code reviews but we are missing some settings
I have a pretty standard attendance database design, but I want to be alerted
I have a NumPy array, i want to accumulate the values of one column,
I have a system that tracks what documents users view. Each document has its

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.