I am creating a single connected wire from multiple trimmed face and tried to create face out of that the code snippet is as belows. (Note:- works fine for planar surfaces)
//Iterates through each face and adds the outer wire to the BRepBuilderAPI_MakeWire
ITrimmedFace^ trimmedFace= trimmedFaceArray->Current;
TopoDS_Wire outerWire = ShapeAnalysis::OuterWire(face);
//Created a single wire out of multiple outer wire
//Creates the ordered and connected wire
TopoDS_Wire orderedWire= Ordered_ConnectedWire(aWire);
//Creates the face out of orderedWire
TopoDS_Face newFace= BRepBuilderAPI_MakeFace(orderedWire);
This works fine for the planar orderedWire,
but if its of nonPlanar orderedWire it is failing.
If someone worked on such scenario and has some solution, please help me out.