Sign in to follow this  
ddengster

Is there a named algorithm for this method of splitting a large triangle into smaller ones?

Recommended Posts

My initial idea for this implementation:

 

- if acute triangle -> split into 4 triangles with vertices on midpoints of the 3 edges of the larger triangle

- if obtuse triangle -> split into 2 triangles with vertex at the midpt of the largest base edge

- repeat until all triangles are smaller than a certain area or edges fulfil a certain minimal length

 

the geometry will be used for small area terrain animations/deformations. would like to know if there're any pitfalls or even simpler alternatives.

Share this post


Link to post
Share on other sites
I don't know of a name, but here's a version I like better:
- For each side of the triangle, check if it's longer than some threshold.
- If all 3 sides are too long, divide the triangle into 4 triangles.
- If 2 sides are too long, divide the triangle into 3 triangles (there are 2 ways to do this).
- If 1 side is too long, divide the triangle into 2 triangles.

This has the huge advantage that the subdivision can be done independently in triangles of the same triangulation without introducing cracks.

Here's an even simpler version with the same feature:
- Pick the longest side.
- If it's longer than some threshold, divide the triangle into 2 triangles.

Share this post


Link to post
Share on other sites

Generally, the process is known as subdivision, and is a pretty extensively studied subject in graphics.

 

Loop Subdivision 

 

Catmull-Clark Subdivision

 

I suspect that handling the acute and obtuse cases differently might be slower than simply doing the midpoint subdivision in all cases.

Share this post


Link to post
Share on other sites

I don't know of a name, but here's a version I like better:
- For each side of the triangle, check if it's longer than some threshold.
- If all 3 sides are too long, divide the triangle into 4 triangles.
- If 2 sides are too long, divide the triangle into 3 triangles (there are 2 ways to do this).
- If 1 side is too long, divide the triangle into 2 triangles.

This has the huge advantage that the subdivision can be done independently in triangles of the same triangulation without introducing cracks.

Here's an even simpler version with the same feature:
- Pick the longest side.
- If it's longer than some threshold, divide the triangle into 2 triangles.

 

Regarding the first method, how is it that you can ensure no cracks? For the 2 sides too long case, when you subdivide into 3 triangles (with a 'z' pattern), the edge that is split in half has an alternative face which may not comprise of the same vertex. If you animate the vertices, you would see cracks.

Share this post


Link to post
Share on other sites

I don't know of a name, but here's a version I like better:
- For each side of the triangle, check if it's longer than some threshold.
- If all 3 sides are too long, divide the triangle into 4 triangles.
- If 2 sides are too long, divide the triangle into 3 triangles (there are 2 ways to do this).
- If 1 side is too long, divide the triangle into 2 triangles.

This has the huge advantage that the subdivision can be done independently in triangles of the same triangulation without introducing cracks.

Here's an even simpler version with the same feature:
- Pick the longest side.
- If it's longer than some threshold, divide the triangle into 2 triangles.

 
Regarding the first method, how is it that you can ensure no cracks? For the 2 sides too long case, when you subdivide into 3 triangles (with a 'z' pattern), the edge that is split in half has an alternative face which may not comprise of the same vertex. If you animate the vertices, you would see cracks.


I don't understand the problem. Both methods ensure no cracks by making the criterion for splitting an edge depend only on features of the edge. Cracks only happen when two triangles share an edge and you decide to split the edge on one triangle but not in the other. Edited by Álvaro

Share this post


Link to post
Share on other sites

 

 

I don't know of a name, but here's a version I like better:
- For each side of the triangle, check if it's longer than some threshold.
- If all 3 sides are too long, divide the triangle into 4 triangles.
- If 2 sides are too long, divide the triangle into 3 triangles (there are 2 ways to do this).
- If 1 side is too long, divide the triangle into 2 triangles.

This has the huge advantage that the subdivision can be done independently in triangles of the same triangulation without introducing cracks.

Here's an even simpler version with the same feature:
- Pick the longest side.
- If it's longer than some threshold, divide the triangle into 2 triangles.

 
Regarding the first method, how is it that you can ensure no cracks? For the 2 sides too long case, when you subdivide into 3 triangles (with a 'z' pattern), the edge that is split in half has an alternative face which may not comprise of the same vertex. If you animate the vertices, you would see cracks.

 


I don't understand the problem. Both methods ensure no cracks by making the criterion for splitting an edge depend only on features of the edge. Cracks only happen when two triangles share an edge and you decide to split the edge on one triangle but not in the other.

 

Yea, I was thinking of that shared edge case you mentioned. thanks for the heads up

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this