Making closed wire from edges

Hello!

Could somebody help, please, with folowing: I have IGES file contaning frofile made of edges. I read the file and get all the edges but i have to compose closed wires from them in order to construct faces (i use faces then to make solids by sweeping them). Could you please advise me an algorythm or maybe ready to use function to construct such closed wires from my pack of edges? Thanks in advance, Dima Ivanets

Divya's picture

hello!can someone plz reply to this post, as I have a similar doubt?

David Egan's picture

try something like
Handle(TopTools_HSequenceOfShape) EdgesQ = new TopTools_HSequenceOfShape();
Handle(TopTools_HSequenceOfShape) Wires = new TopTools_HSequenceOfShape();

for(Exo.Init(aCurrentWire,TopAbs_EDGE);Exo.More();Exo.Next())
{
TopoDS_Edge aCurrentEdge = TopoDS::Edge(Exo.Current());
SF.FixAddPCurve(aCurrentEdge ,NewFace,false,m_GlobalTolerance);

EdgesQ->Append(aCurrentEdge);

}
ShapeAnalysis_FreeBounds::ConnectEdgesToWires( EdgesQ,m_GlobalTolerance ,false,Wires);
Handle(TopTools_HSequenceOfShape) ClosedWires = new TopTools_HSequenceOfShape();
Handle(TopTools_HSequenceOfShape) OpenWires = new TopTools_HSequenceOfShape();
ShapeAnalysis_FreeBounds::SplitWires(Wires,m_GlobalTolerance,false,ClosedWires,OpenWires);
Standard_Integer nbWires =ClosedWires->Length();

if(nbWires==1) aCurrentWire = TopoDS::Wire(ClosedWires->Value(1));

Divya's picture

what is SF.FixAddPCurve(aCurrentEdge ,NewFace,false,m_GlobalTolerance);

m_GlobalTolerance here!how to calculate it?please help!

Divya's picture

Hi David,

In the approach u suggested above: there is a debug break between these statements
SF.FixAddPCurve(aCurrentEdge ,NewFace,false,m_GlobalTolerance);

EdgesQ->Append(aCurrentEdge);

ie when trying to append the edge, the code breaks!!please help!

Divya's picture

Hi David,

In the function SF.FixAddPCurve(aCurrentEdge ,NewFace,false,m_GlobalTolerance);
what does seam-true,false mean?
what is the newface doing?