Obtain vertex indices from STEP file.

Hello,

I would like to obtain the face information from a STEP file, more exactly the vertex indices in order to process them to obtain face information that you could find in a obj file like:

f 1/1/1 3/3/3 4/4/4 2/2/2
f 5/5/5 7/7/7 8/8/8 6/6/6
etc

Where 1/1/1 corresponds to vertex index / vertex texture index / vertex normal index.

I actually have the data from the normals and the vertices, but I don't know how to get the correlation between them.

Regards!

Dmitrii Pasukhin's picture

Hello,

Unfortunately, the problem description is not very clear. Can you give a more detailed description and examples?

Best regards, Dmitrii.

Lorenzo Napl's picture

I'm srry, see the updated topic, hope that this time is more clear.

Dmitrii Pasukhin's picture

You would like to work with tesselation? By default STEP do not content tesselation. Only BRep (geometry).

In this case you need to generate tessalation and use data from Poly_Triangulation. Please take a look into Poly_Triangulation. It can be a Field if TopoDS_Face. And can be generated by IncrementalMesh.

By the way, I need more information.

Best regards, Dmitrii.

Lorenzo Napl's picture

The main goal is be able to convert a STEP file to an OBJ.
I managed to get the list of vertex and normals (using triangulation as you stated before), it only remains the vertex indices. (please see Vertex indices at https://en.wikipedia.org/wiki/Wavefront_.obj_file).
My question is: Do I need to store them manually every time that I iterate over a face? Reading each vertex and normal and saving the index of eachone.
Or does OCCT provide some method to obtain them?
Regards.

Dmitrii Pasukhin's picture

Why you don't want to use our solution to export into Obj?

There an example:step file conversion obj example - Forum Open Cascade Technology

Best regards, Dmitrii.

Lorenzo Napl's picture

From our needs we need to also generate the B-Rep and store that information in our own datamodel in case we want to convert it to other formats.

Dmitrii Pasukhin's picture

So, in this case, please make a look into RWMesh and RWObj Packages.

Poly_Triangulation contains: normals, TCoords (UV nodes), triangles (3 indices into the node (point) container), and a point container. The size of each container is equal(Excluding Triangles container), and they start from 1 (not 0).

Best regards, Dmitrii.