Find an Edge into a Face


the subject seems to be simple, but I'm not reaching what I want.
I have 4 lines (Handle(Geom_Curve)) and build a TopoDS_Edge for each one.
Then a TopoDS_Wire is created from these 4 Edges. (Using BRepBuilder_MakeWire)
Afterwards, when I explore the wire, just one Edge is equal to originals( IsEqual, IsSame or IsPartner ).
Is there a way to get this 'link' between original edges and those inside Wire?

Any comments or suggestions are welcome

Fernando Ghedin's picture

Hello Macedo,

If both IsEqual, IsSame and IsPartner tell you that the Edges are not the same, the only thing that differs is the TSHape.

By reading the description of BRepBuilderAPI_MakeWire Class I can see that, when creating a Wire, it might be the case that the original Edge is COPIED - so, I guess it can have a different TSHape.

Here goes a piece of BRepBuilderAPI_MakeWire documentation:
"(...) In other cases, when one of the vertices of the edge is simply geometrically coincident with a vertex of the wire under construction (provided that the highest tolerance factor is assigned to the two vertices), the given edge is first copied and the coincident vertex is replaced in this new edge, by the coincident vertex of the wire."

Hope it helps, somehow... ;-)

Best regards my friend!

tmacedo29's picture

Hi Ghedin,

Thank you for you answer! ;-)
Actually, I've already checked TShape's differences, and it's exactly my point. I want to have a link between original EDGE and the new one (inside wire), because, since TShape's are different, Shapes are different too! So far, I just have a method with a lot of geometric comparisons to check equality between EDGES.

Do you or someone have a better way?

Thank You again, my friend, and my best regards to you!

Evgeny Lodyzhehsky's picture

Dear Macedo.

The class BRepBuilderAPI_MakeWire inherits BRepBuilderAPI_MakeShape.
The class BRepBuilderAPI_MakeShape contains root interface to history
information you are interresting in:

1. const TopTools_ListOfShape& BRepBuilderAPI_MakeShape::Generated (const TopoDS_Shape& S);

2. const TopTools_ListOfShape& BRepBuilderAPI_MakeShape::Modified (const TopoDS_Shape& S);

3. Standard_Boolean BRepBuilderAPI_MakeShape::IsDeleted (const TopoDS_Shape& S);

The purpose of each method is described in BRepBuilderAPI_MakeShape.cdl

Unfortunately the methods above are not implemented by the class BRepBuilderAPI_MakeWire.

So, there are two ways:
1. To implement the maethods above.
Please have a look the implementation of BRepBuilderAPI_MakeWire
and write your own class that inherits BRepBuilderAPI_MakeShape
2. Use the class GEOMAlgo_Builder (from SALOME) instead of BRepBuilderAPI_MakeWire. The class GEOMAlgo_Builder fuse your edges through vertices if it is possible and provides all info about history
by the methods: Generated(...), Modified(...), IsDeleted(...).