Question about IsPartner()

Hi Everybody!

Suppose I have a close wire, that is compose of 3 edges. All edges are connectibles and the wire is looking good at the screen.

If you look at the following code, can somebody can explain why the fisrt current edge from Wire1 is partner of EdgeA and the the second current edge of Wire1 is not partner of EdgeB (the third current is not partner with EdgeC) ?

TopoDS_Edge EdgeA;
TopoDS_Edge EdgeB;
TopoDS_Edge EdgeC;

BRepBuilderAPI_MakeWire FaireWire;

FaireWire.Add(EdgeA);
FaireWire.Add(EdgeB);
FaireWire.Add(EdgeC);

TopoDS_Wire Wire1 =FaireWire.Wire();

TopExp_Explorer Explo;
Explo.Init(Wire1,TopAbs_EDGE);
while (Explo.More())
{

TopoDS_Shape EdgeWire= Explo.Current();

if ( EdgeWire.IsPartner( EdgeA) ) cout if ( EdgeWire.IsPartner(EdgeB ) ) cout if ( EdgeWire.IsPartner(EdgeC) ) cout

Explo.Next();
}

Thanks you for any answer...

Genevieve

fhchina's picture

I think it is possible that the sequence you get from iteration by TopExp_Explorer is different from the sequence you added them! This is very possible, e.g. the data store in TopoDS_TWire is using hashing table.

So in your code, EdgeA may the first one got from Explorer, but EdgeB becames the third element, I think.

François Lauzon's picture

Hi Genevieve,
you might want to try BRepTools_WireExplorer instead of TopExp_Explorer.

Francois.