multiple objects in one BREP file?


is it possible to have multiple objects in one BREP (or STEP) file?
When I use 'TopoDS_Compound', the shapes are merged together, so that in my modeling application they are all part of one mesh. What I want to archive is having a single mesh for each object. A workaround would be to export each shape to a single file and combine them in the modeler, but that's rather cumbersome.

Thank you,

Aris Karagiannidis's picture

For the case of STEP, I believe that this depends on what methods you use.

Taking from openCASCADE documentation

Standard_Integer num = reader.NbShapes() - gets the number of shapes recorded in the result;

TopoDS_Shape shape = reader.Shape(rank) gets the result identified by its rank, where rank is an integer between 1 and NbShapes;

TopoDS_Shape shape = reader.Shape() gets the first result of translation;

TopoDS_Shape shape = reader.OneShape() - gets all results in a single shape which is:
-a null shape if there are no results,
-in case of a single result, a shape that is specific to that result,
-a compound that lists the results if there are several results.