Different behavior when process mesh and curve in Skp SDK 22.0.316

Dear SketchUp Team,
After we updated SketchUp SDK(21.0.339 to 22.0.316), it has different behavior when processing polygonmesh and curve.
The attachment "
SU_V3_Tower_orig.skp (2.1 MB)
" is a .skp file with model version 4.0.170.
Before update, SketchUp SDK(21.0.339) produced 1430 meshes and 2901 curves.
After update, SketchUp SDK(22.0.316) produced 1443 meshes and 2891 curves. The numbers of mesh and curve are mismatch.

I did some investigation, found that there are some polygons like:
First Vertex: -2591.65, -1594.69, 3307.09
Second Vertex: -2591.61, -1594.76, 3307.01
Third Vertex: -2591.62, -1594.74, 3307.09
First Vertex: -2591.65, -1594.69, 3149.61
Second Vertex: -2591.61, -1594.76, 3149.53
Third Vertex: -2591.62, -1594.74, 3149.61
The vertex in such polygon are extremely closed to each other. In SDK(21.0.339), such polygons maybe ignored, however, in SDK(22.0.316) there are produced as polygon mesh.
I also provde two simplified models:
SU_V3_Tower_2022_simply.skp (1.1 MB)
" contains “Polygon_1” and “Polygon_2”.
SU_V3_Tower_2022_empty.skp (1.1 MB)” contains “Polygon_1”.
Hope my information can be helpful to trace this issue.

Thank you for your time!

It will help the team if you provide a minimum code snippet to reproduce the issue.

We use these APIs (SUEntitiesGetNumFaces and SUEntitiesGetFaces) to extract faces inform:

void SketchUpMeshes::CollectAllFaces()
    size_t nFaces = 0;
    SUEntitiesGetNumFaces(m_entities, &nFaces);
    SUEntitiesGetFaces(m_entities, nFaces, &m_faces[0], &nFaces);

In SDK(21.0.339), SUEntitiesGetNumFaces() returns 1430 meshes, while in SDK(22.0.316) it returns 1443 meshes.

For curves, it is similar:

    size_t curveNum = 0;
    SUEntitiesGetNumCurves(entities, &curveNum);
    if (curveNum > 0)
        std::vector<SUCurveRef> curves(curveNum);
        SUEntitiesGetCurves(entities, curveNum, &curves[0], &curveNum);

Thank you!

We find something may be helpful:
There are some “Polygons” in the original file( SU_V3_Tower_orig.skp), consist of 3 vertex, such as:
-42.011743819761705, 859.36036188168873, 1181.1023622047248
-700.40108463193883, 428.76516393199745, 1181.1023622047248
-618.32422293635204, 482.44449972638245, 1181.1023622047248

We found that these vertex are exactly on the same line, I mean, this “polygon” should be recognized as a curve/line, not polygon. May be this is the reason why number of polygon increased while number of curve decreased.

Changes has been made to how SketchUp validates and checks the validity of models over the years. When you have degenerate cases like this we can’t guarantee how that handling is done. If you have zero area faces or zero length edges they are hard to reason by programmatically/matemathically.