BRepBuilderAPI_MakeWire() question

Hi there,

Here is a newbie question regarding making wires in OpenCascade: How can you make a closed wire out of a set of non-sequenced but connected edges using BRepBuilderAPI_MakeWire() or a similar function ?

For instance, the following form a closed wire:

Edge1
Edge2
Edge3
Edge4
Edge5

but how could you make a wire in OpenCascade given the sequence:

Edge5
Edge1
Edge3
Edge2
Edge4

which might not necessarily be in order of their connecting vertices. I have found the following posting which hints at a solution:

http://www.opencascade.com/community/forum/thread_965/

I am wondering if there is a more efficitent and elgant solution.

Your help is much apprecitated.

Thanks,
Mat

P G's picture

Hello
U can try using this classes ( part of a
working code ).

Good luck

- Prasad

------------------------------------------------
Handle(ShapeExtend_WireData) theData = new ShapeExtend_WireData();

for( .... no . of edges )
{
theData->Add(aEdge);
}

ShapeFix_Wire fixWire;

fixWire.Load(theData);
cout << " No. of edges = " << fixWire.NbEdges() << endl;

fixWire.Perform();
fixWire.FixReorder();
fixWire.FixConnected();

TopoDS_Wire aWire = fixWire.WireAPIMake();
------------------------------------------------

Matiyar's picture

Worked like a charm - thank you Prasad !

The only other thing I needed to do was to close the wire by calling ClosedWireMode() before Peform():

ShapeFix.ClosedWireMode();
ShapeFix.Perform();

Cheers,
Mat