How reliable is FPoly.Triangulate()?

I’m building a fairly simple runtime .obj importer, and I’m using FPoly.Triangulate() to convert larger polygons into triangles. It seems to work fairly well, however, even on relatively simple models, it often throws a bunch of “Triangulation of poly failed”.

Is this just a problem with the function or is there something I can do to the model to ensure it doesn’t happen?

(This is my code to convert a polygon to an array of triangles)

TArray<FGeneratedMeshTriangle> AProceduralMeshActor::CreateTrianglesFromVerticeList(TArray<FVector> inVertices)
{
	TArray<FGeneratedMeshTriangle> outTriangles;


	FPoly newPolygon;

	

	for (int i = 0; i < inVertices.Num(); i++)
	{
		newPolygon.InsertVertex(i,inVertices[i]);
	}

	TArray<FPoly> outPolys;

	newPolygon.Triangulate(GetWorld()->GetBrush(), outPolys);

	for (int i = 0; i < outPolys.Num(); i++)
	{
		FGeneratedMeshTriangle asTriangle;

		asTriangle.Vertex2 = (FVector)outPolys[i].Vertices[0];
		asTriangle.Vertex1 = (FVector)outPolys[i].Vertices[1];
		asTriangle.Vertex0 = (FVector)outPolys[i].Vertices[2];

		outTriangles.Add(asTriangle);

	}

	return outTriangles;

}

Did you find any information on that? I’d be interested as well.

Okay I just ported poly2tri to UE4. Took me only a few hours and the results seem to be good.

http://i.imgur.com/r4mOomp.png

Hi - did you ever use FPoly? any advice on how to fix the following error?
LogGeomTools: Triangulation of poly failed.
I am unsure why it is being thrown - it works with some polygon points, but not others.