BRepOffsetAPI_MakePipeShell create a twisted pipe

Hello,

I'm contributing to the FreeCAD project and I came across a strange behavior with BRepOffsetAPI_MakePipeShell. It seems that in some circumstances the created pipe (using the BRepOffsetAPI_MakePipeShell API) is twisted.

As shown below in the image twisted.png, the pipe appears to be self intersecting,

while in the same pipe (just a little bit smaller) is not (i.e. expected.png).

  • I have made sure that both the start and end section are oriented in the same direction.
  • I've also made sure the spine is in contact with both sections, etc.

Coming from FreeCAD python interface I'm at a loss about what might be the problem as the py infrastructure is directly hooked to the OCCT library.

This strange behavior has been tested both on OCCT 7.6.3 and OCCT 7.8.1.

I've also opened a bug on FreeCAD: 18658

I would really appreciate any idea about what might be the problem.

Thanks a bunch

Attachments: