All OBJ vertices incorrectly equal (0,0,0) (E notation Bug?)

I’m attempting to carry out some coordinate transformations for meshes, i’ve successfully done this for FBX files, but I have an OBJ file which I am testing and every vertex has the position (0,0,0).

The obj does have several thousand polygons and control points, when viewing the OBJ in MeshLab, the count of each matches that which I log from Aspose.

Here are the first three coordinates copied directly from the .obj file, maybe Aspose can’t handle E notation?:

v -3.12842593e-01 2.17075611e+01 3.50575465e+01
v -3.12842593e-01 2.16943491e+01 3.69071182e+01
v -3.12842593e-01 2.14158294e+01 3.69164094e+01

Using the below, all the control points are located at 0,0,0:

node.Accept(delegate (Node node)
{
    for (int i = 0; i < node.Entities.Count; i++)
    {
        if (node.Entities[i] is Mesh mesh)
        {
            var points = mesh.ControlPoints;

            for (int j = 0; j < points.Count; j++)
            {
                var v = points[j];
                Console.Writeline(v.ToString())
            }
        }
    }
    return true;
});

When getting the vertices from a TriMesh the issue persists:

    rootNode.Accept(delegate (Node node)
    {
        for (int i = 0; i < node.Entities.Count; i++)
        {
            if (node.Entities[i] is Mesh mesh)
            {
                var vertexDeclaration = new VertexDeclaration();
                var vertexFieldForVertex = vertexDeclaration.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Position);
                if (mesh.GetElement(VertexElementType.Normal) == null)
                {
                    var normalData = PolygonModifier.GenerateNormal(mesh);
                    mesh.VertexElements.Add(normalData);
                }
                var triMesh = TriMesh.FromMesh(vertexDeclaration, mesh);

                foreach (var vertex in triMesh)
                {
                    var v = vertex.ReadFVector3(vertexFieldForVertex);
                    Console.WriteLine(v.ToString());
                }
            }
        }
        return true;
    });

What could be causing this issue? The model can be viewed fine. Can I send it over to you?
Also, what would be the most efficient way to loop through all of the XYZ verticies of a Mesh?

Thanks

OBJ image in MeshLab:
image.jpg (411.7 KB)

EDIT: Exporting the mesh using Aspose (only importing/exporting), the resulting file within MeshLab has the same number of vertices / faces, yet nothing is visible:
image.png (101.5 KB)

EDIT:
Removing the E notation from the points allowed me to load the OBJ. Obviously not a fix and I can’t achieve what I set out to do, but at least we’ve found the issue.

@TPovey2

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes/investigation results according to the terms mentioned in Free Support Policies.

Issue ID(s): THREEDNET-1325

Please be patient and spare us some time. We are sorry for the inconvenience.

Any news on this?

@TPovey2

We are afraid that the ticket has not been yet investigated. However, we will surely inform you as soon as its investigation is complete and we have some news about its resolution ETA. Please be patient and spare us some time. We are sorry for the inconvenience.

@asad.ali Why has this been marked as resolved?

The issue is still very much present. I am still in the trial period for the licence, I would like to purchase a licence but only if there is a resolution to the above, otherwise this library does not achieve our requirements.

As noted above, a vertex with the notation:
v -3.12842593e-01 2.17075611e+01 3.50575465e+01
in an OBJ file will be translated to
(0,0,0) using Aspose.

It should return:
(-0.312842593, 21.7075611, 35.0575465)

Is this a bug related to E notation, or to precision?

The models with this notation load fine in packages such as MeshLab, Autodesk Navisworks, Blender etc…

Is a fix on the way, is this why it has been marked as resolved?

Thanks

@TPovey2

The ticket has been resolved in 23.2 version of the API which is yet to be released. It will be released soon within this month. You will be able to obtain desired results by using this upcoming version of the API.

1 Like

That’s great, thanks @asad.ali

Will this fix just be for OBJs, or also for other 3D formats (e.g. FBX)?

@TPovey2

The ticket was logged only for OBJ files and we are certain about this format only. However, you can try with other formats as well and let us know in case some issue happens.

Thanks, I’ll see if I can get some other formats which use the same notation and test if the issue is still present. I’ll reply back in this thread with my findings.

@TPovey2

Sure. Please feel free to let us know in case you find some issues.

The issues you have found earlier (filed as THREEDNET-1325) have been fixed in this update. This message was posted using Bugs notification tool by Aspose.3D Team.