Geometric Edge and Face IDs

Hello,

I am new to OpenCascade and BRep, STEP and other file formats. I am trying to mesh some
BRep models using NetGen, Gmsh and other public domain software.

I am stuck with one problem. I am interested in comparing results with various software
( and sometimes for debugging) and it seems that different readers assigns different
integer IDs for different geometric edges/faces in the model. Therefore, I am unable to
get one-to-one matching from different software.

My naive question is: Who assigns the Integer IDs to the model entities ? I guess that
it must be included in the model itself, so different readers must give back the same
entities, but it is not happening. How can I have get the same geometric entities ?

Thanks.
csv

Roman Lygin's picture

Hello,

There are no persistent id's attached to Open CASCADE entities in memory or in a brep file. There are temporary integers used instead of references in the file (or when you use the 'dump' command in Draw). Determinism is ensured by unambiguous traversal of the shape graph (from a shape itself recursively to all its children following the order in the child list).

Mapping of some arbitrary id's from external file to OCC shape would be job of your app. For instance, following XDE approach, using OCAF. Explode the shape into subshapes, attach each to the labels along with integer attribute. Alternative is to use some hash (data map) that would store mapping between shapes and integers.

Hope this helps.
Roman

---
opencascade.blogspot.com - the Open CASCADE blog
www.cadexchanger.com - CAD Exchanger, your 3D data translator