Wed, 05/03/2023 - 12:35
Forums:
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!
Wed, 05/03/2023 - 15:56
Hello,
Unfortunately, the problem description is not very clear. Can you give a more detailed description and examples?
Best regards, Dmitrii.
Wed, 05/03/2023 - 17:39
I'm srry, see the updated topic, hope that this time is more clear.
Wed, 05/03/2023 - 17:43
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.
Wed, 05/03/2023 - 18:17
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.
Wed, 05/03/2023 - 19:24
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.
Thu, 05/04/2023 - 10:56
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.
Thu, 05/04/2023 - 11:44
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.