closed wires and ShapeAnalysis_FreeBounds::ConnectEdgesToWires

Hi all,

I want to make a wire from a bunch of data representing arcs and lines. These elements compose a closed contour, but initially they are not ordered, so I think I must use ShapeAnalysis_FreeBounds::ConnectEdgesToWires to order and compose a wire (or set of wires).
To do this, I make the edges from the initial data, and pass the parameters to ShapeAnalysis_FreeBounds::ConnectEdgesToWires.
The problem is that if the contour is closed, the function returns two opened wires instead of only one closed. I have checked that all the extrema are OK (i.e., no tolerance issues). In addition, if I pass as parameter all the elements except one, the function returns only one wire, so it seems to work well for open contours.
Does someone experienced this issue? Am I doing something wrong?

Thanks in advance
Jordi Xuclá

Fotis Sioutis's picture

Hello Jordi,

Try to fix the ConnectEdgesToWires resulting wires using ShapeFix_Wire class, then feed the resulting wires in ConnectWiresToWires in order to get your final "correct" wires.Please note that also the final wires may need to be "fixed" using ShapeFix_Wire.

Fotis

jordi's picture

Fotis,
thanks for your response. It seems that ShapeFix_Wire needs a wire and also a face, if I'm rigth. But I don`t have the face: in fact, obtaining a face limited by the wire is my final objetive :)
I have tried to feed again ConnectEdgesToWires with the first result (i.e. for 33 edges I obtain 2 wires, and I use those wires to call ConnectEdgesToWires), but the result is again 2 wires. And also, if the two wires don't make a close contour, ConnectEdgesToWires joins them rigth.

thanks
Jordi

Fotis Sioutis's picture

Jordi ,

In my case i implemented a sketcher which connects a list of arbitary edges to wires, and faces (with holes) where possible.I believe that you try to achieve the same thing.Try to follow the exact recipy i provided above since it works fine for me.For the face parameter of the wire fixer i used the sketch plane.Now if the list of edges is not planar, then you will have to try to use the fixer with an arbitary or without plane.Hope this helps !

Fotis

jordi's picture

Fotis,
success! As you said I must use the first results of ConnectEdgesToWires, fix them, and feed again ConnectEdgesToWires, and the contour is made correctly.

That said, I wonder if I can trust on the second pass or in general I have to make those steps till I obtain what I am expecting.

Thank you again
Jordi

Fotis Sioutis's picture

Jordi,

In my case i feed the fixed results to Connect WiresToWires and not Connect EdgesToWires !. Afterwards i fix again the new result and it is always ok !

Fotis

jordi's picture

rigth, it is ConnectWiresToWires (Copy & Paste, you know).