Better way to triangulate complex polygon

Better way to triangulate complex polygon

VedranB
Contributor Contributor
14,266 Views
28 Replies
Message 1 of 29

Better way to triangulate complex polygon

VedranB
Contributor
Contributor

Hi all,

 

I'm hoping someone with more experience can help me with this.

 

I have a large complex polygon and I need it to be clever when triangulating but instead all it does is create a right mess.

This shape was imported as a DAE, attached all the geometry into one object and welded the verts together.

 

I have tried the following:

Triangulate modifier
Selecting all verts and connecting
Converting to patch then back to edit poly.

 

I have attached an image below that shows the desired result.

 

All methods lead to the mess you see below.

 

If anyone could help it would be much appreciated.

 

 

Triangluation Problem.jpg

0 Likes
Accepted solutions (1)
14,267 Views
28 Replies
Replies (28)
Message 2 of 29

Anonymous
Not applicable

The reason you can't get the vertical line segments the way you want is because your geometry is lacking vertices along the long straight edges of your piece. 

 

Dean

Message 3 of 29

VedranB
Contributor
Contributor

Thanks for the reply,

 

My apologies i should have been more clear, there are lots of vert.

Here is an updated image:

 

Triangluation Problem.jpg

 

Thanks

0 Likes
Message 4 of 29

Anonymous
Not applicable

have you tried putting an editable poly on your geometry and under "Edit Elements" clicking retriangulate?

0 Likes
Message 5 of 29

VedranB
Contributor
Contributor

Nothing happens...

0 Likes
Message 6 of 29

Anonymous
Not applicable

Can you share the geometry? Getting the edges to go the way you want them to might be a matter of editing them by hand.

0 Likes
Message 7 of 29

VedranB
Contributor
Contributor

Unfortunately there is about 60km of these polygons so doing it manually is not really an option.

 

Here is a link to the segment:

https://u82121024.dl.dropboxusercontent.com/u/82121024/Triangulated%20Mess.max?dl=1

 

Thanks

 

0 Likes
Message 8 of 29

PiXeL_MoNKeY
Collaborator
Collaborator

Have you tried the Subdivide Modifier, or the Turn To Poly (Limit Polygon Size: 3)? Both give you options for editing the triangulation. Be careful with the Subdivide as it can actually add new verts.

 

-Eric

0 Likes
Message 9 of 29

VedranB
Contributor
Contributor

Thanks for the suggestion.

 

Yes to both but no success Smiley Sad

0 Likes
Message 10 of 29

Anonymous
Not applicable

Is this what you are trying to do?

0 Likes
Message 11 of 29

VedranB
Contributor
Contributor

Thanks for taking the time to make the video but as I mentioned above there is about 60km of this and going through like that is not an option due to time constraints. 

 

0 Likes
Message 12 of 29

Anonymous
Not applicable

Whats the end goal? do you need to bend the geometry?

0 Likes
Message 13 of 29

VedranB
Contributor
Contributor

no, this is used to join two different terrains and the way it currently triangulates causes bad shading and is unusable.

It will then be used in a real time application.

0 Likes
Message 14 of 29

Anonymous
Not applicable

Hmm. I don't know of an automated way for you to get the geometry looking the way you posted. If its a shading issue, have you tried to remove smoothing groups and re-smoothing? I would have thought that adding a subdivide modifier would have added more geometry (not the way you illustrated though) and fixed shading issues. Maybe @Alfred.DeFlaminis would have some insight.

 

Short of redrawing the geometry from scratch (I realize that's not an option) I think I'm running short of ideas

0 Likes
Message 15 of 29

VedranB
Contributor
Contributor

Currently the triangulation is causing some of the polygons to have large crease angles so re-smoothing the shading makes it look worse.

Sub dividing keeps most of the same triangles that triangulating does then sub-divides those so the issue doesn't get fully resolved, plus the extra polygons are not an option either.

 

Thanks for taking your time to help!

0 Likes
Message 16 of 29

Anonymous
Not applicable

Hey Vedran!

 

From what I'm seeing in the piece you shared images of, you're probably going to need to do manual connections for verts by hand.  Just selecting two of those opposing verts and hitting "connect" will give you a clean poly line, and if you're doing that in pairs they'll automatically triangulate the way you want them to.

 

I know that's probably not what you want to hear, and it'll be a pain, but if you need to keep the exact same geometry and get the clean example you gave that's probably going to be the only way.  You can try setting up clean lines every 10-20 vert pairs instead of each one, but by default Max tends to triangulate polys in ugly ways.

 

What engine are you putting these landscapes into?  That can vary a lot, but typically you want to use displacement maps to avoid issues like these.  Depending on the engine you could import your original mesh, paint using landscaping tools (if you're using UE4 for example, and then stop using the meshes so you can stay on their tools.

 

Happy to answer any questions about that you might have!

Message 17 of 29

VedranB
Contributor
Contributor

There surely must be a way...

We use our own in house software which uses meshes for terrains so have no other choice.

 

They have (super) computers that can beat a champion human at the worlds hardest board game surely a better algorithm could be written to triangulate Man Frustrated

0 Likes
Message 18 of 29

Swordslayer
Advisor
Advisor

If you don't care about having additional edges, use some of the gridslice scripts out there, if you care about that, try remeshing it in MeshLab.

Message 19 of 29

Francisco_Penaloza
Advisor
Advisor

Well to be honest sometimes the isn't a better way, just hard labor.

I took a look at your geometry and it is very messy to start. If this is to be used in a game engine I would rebuild the whole path from a simple polygon and extrude, move rotate, extrude again and so on. That's the only way to get an organized and way optimized mesh, this one already has many triangles.

 

I think this is a road correct? is fo, no Human made road are this irregular, If it is a natural path road, then you better model the whole thing from scratch

It would take you longer to try to fix this than building it from scrash.

 

The other method would be as mentioned select every 2 vertex and connecthem. this may be faste than re build.

Best luck.

 

Message 20 of 29

VedranB
Contributor
Contributor
Accepted solution
It's not a road... it's the joining of two terrain meshes. it's about 60km long and I'm looking for a quick way to do.

I've luckily found a quick way. I convert the border to a spline, delete the two ends so there are two separate segments then using the 'cross section' feature drag from one side to the other.

I had to split the whole section into about 10 or so sections but it worked well.

Thanks everyone for your time and input!