+ BRep_Builder B;
+ TopoDS_Compound aFaces;
+ B.MakeCompound(aFaces);
+
+ // simplify compound structure for
+ // Mantis issue 0023419 (note 0021712)
+ TopExp_Explorer aExp;
+ TopTools_MapOfShape aMapFaces;
+ aExp.Init(theShape, TopAbs_FACE);
+ for (; aExp.More(); aExp.Next()) {
+ const TopoDS_Shape& aFace = aExp.Current();
+ if (aMapFaces.Add(aFace)) {
+ B.Add(aFaces, aFace);
+ }
+ }
+