Read the MANIFOLD_SOLID_BREP entity as a single and separate shape

Hi I am reading a step file using the STEPCAFControl_Reader and writing the glb file using the RWGltf_CafWriter.
The step file contains the part objects with multiple solid bodies. You can see below in the Step entities.

#26216=PRODUCT_DEFINITION('C101046-01','C101046-01',#26240,#26195);
#26127=PRODUCT_DEFINITION_SHAPE('',$,#26216);
#26099=SHAPE_DEFINITION_REPRESENTATION(#26127,#26191);
#26191=SHAPE_REPRESENTATION('',(#13231),#26067);
#371=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#1333,#1334),#26067);
#1333=MANIFOLD_SOLID_BREP('Solid1',#11457);
#1334=MANIFOLD_SOLID_BREP('Solid1',#11458);

C101046-01 is the object which has two solids under it defined by MANIFOLD_SOLID_BREP entity
Currently these two solid are getting merged in a single shape and I am getting a single shape in the output glb file.

I want to export a single solid as a single separate shape into the glb file and the object C101046-01 as sub-assembly.
Can anyone help me in this?

Vikas Beske's picture

Hi,

Can anyone help me on this?

regards

Dmitrii Pasukhin's picture

Hello, there are at least 2 solutions:

1. Create a TopoDS_Shape directly from each MANIFOLD_SOLID_BREP by converter. In this way extracting any type of attribute will be complicated. And only specific for the same file content (not general solution)

2. Iterate over the result compound and extract subshapes.

Which way is more comfortable for you? It depends on specific task or general task type.

Best regards, Dmitrii.