In some dxf, especially when revit is involved, data might be contained like the following:
3DFACE
... removed for brevity
13
511577.6488682699
23
1365679.835179607
33
80.42828687855729
1001 <<<<< REVIT DATA - EXPECTED 0
REVIT
parse3DFaceVertices will collect 13,23,33 as expected but because the following code is 1001 instead of 0, it leaves the function without pushing that final vertex into vertices. due to this many quads end up as triangles.
I propose adding one final check for vertexIsStarted and pushing that vertex in so that quads will be formed properly.
Thanks!