Face from Faces

I have a set of Faces. Is it possible to make only one Face from this set. The Face must have only contour wire without other lines like on attached picture.

Attachments: 
jelle's picture

What about this:

1) join faces in a shell [ sew the shapes ]
2) loop through the edges; check if the edges are TopAbs_EXTERNAL, keep track of those
3) build a new face with the edges who's orientation is TopAbs_EXTERNAL

Good luck,

-jelle

Alexey Gorshkolep's picture

Glad to see your answer.
I have already tried to Sew faces and had an exception in Perform metod. By the way set of faces l obtain from projection of shape using HLR and ShapeFix Wire classes

Game Milky's picture

Hi Alex have solved the problem!

Would you share ur idea!
Regards

Alexey Gorshkolep's picture

Hi Game Milky! Sorry for my English :)
Generally, my task was to find a 2D silhouette of the Shape and unfortunately I didn’t solve it. I got the 2D projection with HLR classes then I wanted to build a face from this projection lines. I tried many methods but unsuccessfully.
So you may try to use ShapeFix_Wire class and ShapeAnalysis_ classes (or other ShapeFix) to build a closed wire and then to build a face from it. For example (sorry, don’t remember work it or not):

Handle(ShapeFix_Wire) aShFW = new ShapeFix_Wire();
Handle(ShapeExtend_WireData) aWD = new ShapeExtend_WireData();
for(TopExp_Explorer edgeExp(face, TopAbs_EDGE); edgeExp.More(); edgeExp.Next())
{
aWD->Add(TopoDS::Edge(edgeExp.Current()));
}
aShFW->Load(aWD);
aShFW->ClosedWireMode() = Standard_True;
aShFW->FixReorder();
aShFW->FixConnected();
TopoDS_Wire awire = aShFW->Wire();
BRepBuilderAPI_MakeFace mf(awire, Standard_True);

Good luck! Please, notify me if you will find a solution!

Game Milky's picture

Thank you very much for your reply!
Thank you for your information too!I will try your suggestion and back to you soon after. Currently i am dealing with sewing as i am not really looking for only one face. Rather, looking for closed or connected faces. But for your case, to make one face from multiple faces, have you tried BrepAlgoAPI_Fuse class. You can find it in Modeling Algorithm user Guide!

Thank you very much

I will notify you soon,
Game