• Create Account

## Given a set of Vertices: Determine Boundary Vertices and Connection Order

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1gretty  Members

268
Like
0Likes
Like

Posted 02 February 2014 - 03:36 AM

Hello

I am looking for suggestions on algorithms I can use to determine the boundary points/vertices of a list of vertices. I also need to determine which boundary point connects to which other boundary point.

I have my own solution but it involves alot of steps and is more procedurally based rather than mathematically based. Can you suggest any algorithms (both procedural and mathematic)?

My approach:

•    - Organise the vertices into a Dictionary <int, List<Triangle>> vertexTriangleMap. Where the keys are the indexes of the vertices and the values are lists of the triangles that involve that vertex
•    - Pick a random vertex(RV) then pick a random triangle involving that vertex. For eg; vertexTriangleMap[9][0]
•    - Of the 2 other vertices in this triangle: Determine which involves the least triangles (the point w the least triangles = OV)
•        - Search through OV's triangles looking for another triangle that involves the vertices OV AND RV:
•            - if there is more than 1 triangle that involves these 2 points then that means that OV is NOT a boundary point else OV is a boundary point AND I know it connects to RV. OV now becomes RV and I can now repeat the process and I will determine which boundary points connect to which. I'll know when to stop when I reach the beginning again (the first RV).

Edited by gretty, 02 February 2014 - 03:40 AM.

5832
Like
0Likes
Like

Posted 02 February 2014 - 04:03 AM

Look for edges... a boundary vertex is on an edge which is only included in 1 triangle.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

### #3gretty  Members

268
Like
0Likes
Like

Posted 02 February 2014 - 04:15 AM

That will help me ensure that the first random point is infact a boundary point but not all boundary vertices involve 1 triangle. Look at the example picture on my OP. The top left corner involves 2 and the next 2 boundary points below involve even more triangles.

Determining the number of triangles each vertex is involved in and using the least as the boundary points was my original approach but it doesn't work. For irregular TINs (Triangular Irregular Networks), like ones that aren't rectangular, a boundary point can have as much as 5 triangles or more.

Edited by gretty, 02 February 2014 - 04:16 AM.

5832
Like
0Likes
Like

Posted 02 February 2014 - 04:55 AM

A boundary edge does involve just 1 triangle though. Do you not know edge information for your vertices? Find the edges then classify the vertices.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

### #5eppo  Members

4601
Like
0Likes
Like

Posted 02 February 2014 - 07:23 AM

Not clear if you already have a triangulation. If not, there are an infinite number of ways to triangulate a vertex cloud; to define connectivity between vertices. If you only need to connect vertices on the boundary, computing the convex hull (QuickHull algorithm) probably makes most sense. If you want to allow concavities in the hull, you could insert vertices into a Delaunay triangulation.

Edited by eppo, 02 February 2014 - 07:26 AM.

### #6gretty  Members

268
Like
0Likes
Like

Posted 02 February 2014 - 03:45 PM

Not clear if you already have a triangulation. If not, there are an infinite number of ways to triangulate a vertex cloud; to define connectivity between vertices. If you only need to connect vertices on the boundary, computing the convex hull (QuickHull algorithm) probably makes most sense. If you want to allow concavities in the hull, you could insert vertices into a Delaunay triangulation.

Thanks QuickHull looks like a nice elegant solution but unfortunately wont work for the tins I am working with - they are tins of roads so imagine a loose 'J' shape. With QuickHull I'll end up having the end of the J joined to the start of the J I believe.

I'll look into Delaunay, at first glance it looks like this algorithm calculates all vertex connections/triangles and not just the boundary points? Is that correct?

Yes, the information I have is the triangulation and the vertices, thats the only information I have but not the boundary vertices or their connection order.

Edited by gretty, 02 February 2014 - 03:47 PM.

5832
Like
0Likes
Like

Posted 03 February 2014 - 12:42 AM

Well it's not hard to build a list of edges from triangulation data if neighbouring triangles share vertices. Once you have edge information it is easy to find boundary edges and vertices.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.