Wire missing afte Fuse?

I've been trying to "glue" two or more coplanar faces together. On the file attached I show such an example where there are 5 faces to be "glued". The thing is, I want to get rid of all the inner wires, so that only the "convex hull" is left and I can create a face with it.
The problem is, I've got an algorithm that consists of fusing all faces together and then using Prs3d_ShapeTool to iterate my fused shape, select all wires that have only 1 neighbour, and then using a makewire to join then, and finally generate a face.
Seems perfect, but after fusing more than 2 or 3 faces I've been facing a problem. Some wires are missing. Even if I iterate my fused shape using TopExp_Explorer eExpl(fused_shape, TopAbs_EDGE) these wires are missing, but if I iterate my fused shape using TopExp_Explorer fExpl(fused, TopAbs_FACE), all the faces are there, even the one that uses the missing wire.
On the attached file it shows another screenshot showing my missing wire.

What I expect to get is also shown on the attached file, beign the bottom screenshot, using a smaller number of fused faces.

Can anyone help me with this? Am I doing the wrong approach?

Rostislav Khlebnikov's picture

Hi. Just looked into your topic because I also fight with fusing. Quite a different kind though.
However, it looks you might be facing the same problem which I will post a bit later as a separate topic with some good name. What I found out is when an edge is split into two during fusion there are two things that happen - two edges are created, both sharing the same curve. Obviously, they have different parameter ranges. Seems like these parameter ranges are stored in two different places - in the vertices (accessed through BRep_Tool::Parameter(Edge, Vertex), and in the curve itself - I got them using BRep_Tool::Curve(Edge, outFirstParam, outLastParam). And you know what? They are mixed up!

I mean first edge has vertex parameters, say, [0, 0.3] and the second one - vertex params [0.5, 1.0] - the part in-between [0.3, 0.5] being cut off by other entity. BUT! The curve parameters are just the opposite - the first edge has them as [0.5, 1.0] and the second one - [0, 0.3]! Maybe you could check it yourself and see if it's the same issue?

This looks like a bug to me. Something tells me that this is a new bug as well.

All best,

Rostislav Khlebnikov's picture
Rostislav Khlebnikov's picture

Sorry, messed up my post a little.
outFirstParameter and outLastParameter are the same as vertex parameters.
But if you call FirstParameter() and LastParameter() on the curve that you got with BRep_Tool::Curve - those will be opposite.

Rostislav Khlebnikov's picture

I have to apologize. It was a bug in my code. So I guess I'm of no help here.