Need To Access Consistent Unique Identifier When Converting Step to GLB

Hello!
I have been working on a Step -> GLB converter for our specific use-case.

When traversing the labels, is there a unique identifier imported from the Step file that is accessible? Even tree location would be useful if it was guaranteed that each tree location was unique (no duplicates for repeating parts in different assemblies). I have also had issues getting this data, beside accessing the tag and using rapidJson to process the data.

The reason we are doing this is to create an ID schema in the output of the glb that is consistent every time the same model is converted.

This becomes ever more useful due to extras data (per node) in GLTF export is not accessible till 7.9.0 release. An example would be, if we can associate a dimension to the unique identifier, further down in our pipeline, we can use the association for various reasons.

The current plan is to create a map when processing the shapes in OCCT, then process the GLB afterward in a different program.
Map example being
<dimensionId, part1Id-part2Id> (if the dimension is attached to two shapes)
or
<dimensionId, part1Id> (for a datum or any dimtol with a single shape reference)

Thanks ahead of time!
-Jonathyn

gkv311 n's picture

For the moment, you may rely on 'name' property of 'nodes' and 'meshes', which generation is managed by RWGltf_CafWriter::NodeNameFormat() and RWGltf_CafWriter::MeshNameFormat() properties, and depends on names, assigned to XCAF document labels (translated from STEP - name of instance, product, etc.). Which might be non-unique by default.

You may also customize name generation by overriding method RWGltf_CafWriter::formatName().

Not that STEP and glTF formats have different definition of model structure, so that OCCT just tried to map to glTF as much useful information as possible.

Jonathyn Major's picture

Thank you for the response! Very helpful. Just to clarify, what is the method to access the tree placement of a shape? i.e. 0:1:1:2. I imagine the only method to get data from a shape into RWGltf_CafWriter at this point is through the name, right?