Sewing of faces

I have two TopoDS_Face and I would like to join them together. When I use BRepOffsetAPI_Sewing to do this, and then interrogate the resulting shape, it contains two faces rather than the single face I was hoping for. I am a little confused as to what the sewing operation has actually done! Am I using it incorrectly or is it not capable of producing a single face by sewing two faces together?

Roman Lygin's picture

Dear Neil,

The purpose of BRepOffsetAPI_Sewing is to TOPOLOGICALLY connect faces that are GEOMETRICALLY coincident.

The input for the algorithm is a set of faces that have coincident (within given tolerance) edges but NOT shared, the output is a shell or a compound of shells that contain faces that SHARE edges between each other.

Thus, Sewing performs topological(!) sewing without changing number of faces and modification of underlying surfaces. So, result you get is quite correct.

The task of "gluing" surfaces (or only parts of them restricted by faces) into one is complicated (since surface geometries can be of different kinds and parameterisation) and can be solved, for instance, with methods of approximations.

By today, there is no general algorithms that would solve this task. The particular case of "glueing" grid of Bezier surfaces into single B-Spline surface is solved by class GeomConvert_CompBezierSurfacesToBSplineSurface. Please have a look at it.

Best regards and good luck,

Roman