Ngon triangulation

Hi,

I have been having some problems exporting to Cryengine with Cryblend. And I found that the problem seems to be triangulation of ngons when exporting to OBJ format.

Does this look correct to you? To me it seems like the faces are not welded properly. (Triangulating with CTRL+T)

Here I have only subdivided one face twice and extruded the four center polygons, then triangulated all faces.

I have been investigating a bit, and my conclusion is that in 2.63, with bmesh and ngons, when triangulating (or exporting to dae, where triangulation is performed), there are some errors.

The vertices you see above are not connected to the adjacent face because they are part of a face with 0 area, that have an edge coincident to the adjacent face. If you pull the vertices, you see how some mysterious faces appear. This is a problem for us working with cryengine (any person who export to games I believe), since we get errors when exporting to cgf format.

You can see these hidden 0 area faces when pulling in the vertices. I would expect that if you triangulated the ngons, they would give the same result as when you subdivide just one face in 2.62.

Uhhh, do you really need all that geometry for that simple shape?

Anyway, vertices cannot be merged with a face, they need another vertex lying on the same spot to be able to merge with them (if that makes sense)

  1. Of course you do not need all that geometry, this was just a test to find errors when exporting with cryblend.

  2. I do not think you understand the problem. This is just a cube, with one face subdivided twice, and five faces without subdivision. You would expect when triangulating that all the vertices would connect, even the ones that are marked in red in the first post.

Your explanation is not correct. I found that the problem is that blender 2.63 creates several faces with 0 area when triangulating, so the reason for the vertices not connecting is that they are coincident with the edge of the two perpendicular faces, although there are two separate edges that are coincident, so the faces are not at all connected.

Just try this: Make a cube, subdivide one face twice, select all faces, triangulate (ctrl + t), now pull in the edges or vertices that I marked in red, you will se what a mess of roaming vertices, and strange connections you have.

Repeatable in r47753. It seems to happen when you have collinear vertices - if you stagger them slightly while still maintaining a convex ngon the triangulation works.

EDIT: … four or more collinear vertices. You can subdivide one edge of a plane twice and see the same issue, FYI. I don’t see a bug reported for this in the tracker.

Reporting it on the bug tracker if it’s not there is a good idea.

There’s a GSOC triangulation project this year,

New tesselator + “nice triangles” - Andrei Simionescu (Mentor: Campbell Barton)
The idea is to build a new tessellation tool to replace the old scanfill one. The new tesselator should be fast, first of all, but also handle degeneracies, handle non-planer polygons, deal with the general case of polygons containing other polygons. Post-processing the tessellation/triangulation to make “nice” triangles/quads/etc. as a basis for an improved ‘Beautify’ tool.

Hopefully it will help to fix all those really bad things Bmesh can do when generating those 0 area faces.

Beautiful guys, I was feeling that I was the only one seeing this problem :smiley:

Sorry, I am kind of new to blender, could you point me to where to report bugs?

Reported: http://projects.blender.org/tracker/index.php?func=detail&aid=31807&group_id=9&atid=498

Seems for work for me (2.63a):
http://img7.imagebanana.com/img/8dqvrvio/thumb/untitled.png

Does not work for me (2.63a x64)

There is a patch now, I am a windows user, and I don’t know how to use this just yet. I have found some tutorials that I will look into when I find some time.

http://projects.blender.org/tracker/?func=detail&atid=498&aid=31807&group_id=9

Patch: http://projects.blender.org/tracker/download.php/9/498/31807/21167/bt31807_triangulation_errors.patch

Hi guys,

Yes, would be cool if you could stress a bit that patch with heavy/tricky models, before I bother Campbell to review it… :wink:

Committed as r48243!