Why mustn't a non-manifold closed wire be flagged as "closed" in Open CASCADE?

Hi, I'm using BRepLib_MakeWire to create a closed wire from edges connecting vertices on the triangulation of a face. Now I happen to have loops in there, so the resulting wire is non-manifold (there are vertices traversed twice). Yet it is a perfectly closed wire. But BRepLib_MakeWire::Add fails to recognize this, yet it returns in state "BRepLib_WireDone". This handling of non-manifold wires seems to be intentional. The routine checks for closedness if and only if the wire is a manifold wire! Could somone explain to me why? Closedness can be defined for a non-manifold wire as well, because the edges in a wire are sorted. Therefore it's completely clear which path the wire is describing even if there are points traversed twice. Why is it not possible to have a closed, non-manifold wire in Open CASCADE?

I assume there are algorithms present in OCC, working on closed wires and assuming that the wires are non-manifold, right? Wouldn't it be much wiser (in that case) to introduce a flag "manifold" for shapes like wires, edges and faces? Can you point out which algorithms are making this assumption? Then I could potentially flag my wire as "closed" manually.

Attachments: 
Bearloga's picture

Fabian,
The edges in a wire are not sorted in general case.
I think one of the causes why non-manifold wires are not supported by OCC is that the classifier of a point won't work.

Forum supervisor's picture

Dear Fabian,
BRepLib_MakeWire is not intended to work with non-manifold topology.
If you want to build non-manifold wire you may use BRep_Builder.
Just don't forget to sort edges and create common vertices before by yourself.
Regards