Building CompSolid from IGES

I have an IGES file of a partitioned shape that has to be CompSolid which is formed of 4 Solids. But when I read the file, I don't get any CompSolid or Solid but I get 4 Shells which are not complete (faces of some shells are missing i.e. when two shells have a common face, only one shell has it) How can I build 4 Solids and a CompSolid from such data?

Thanks in advance

Francois Lauzon's picture

I not sure IGES has a great support for SOLID topology, depending on which system your file was generated from. If you could use something like STEP, you might not have to deal with regeneration of your geometry.


Roman Lygin's picture

It depends where you translate your initial data from and which destination IGES format you choose. Most systems deal with IGES prior to 5.1 which does not support solids and translate into groups of Trimmed Surfaces (type 144). IGES 5.3 does support faces, shells and solids (not sure about compsolid).
Open CASCADE is capable of reading IGES 5.3 and translates its entities into TopoDS_Face, _Shell, _Solid (see files in the IGESToBRep package). But you won't get TopoDS_CompSolid for sure (there is no such resulting type).

If you, by chance, translate first from Open CASCADE to IGES and then read it back, and if you originally have TopoDS_CompSolid it will translate to IGES group and a set of IGES solids (see BRepToIGESBRep sources). However this all also depends on static parameter "write.iges.brep.mode" (which by default translates into IGES Trimmed Surfaces).
Hope this helps.

PG's picture

Interesting info.
Most of the IGES files I have come across after parsing , the OCC shape type is COMPOUND, though they are all Solid parts in the original system. Look at the IGEs samples files bundled in OCC installation folders (data/iges). Is it a compound of FACES or SHELLS ? Then how to know to know the BREP is a closed volume or open body ?
How do you convert/map into a SOLID(closed volume) shape type ?