Robust wire offset

Hello,

I want to implement a small code that takes a shell as input and does the following: extract the outer edge of the shell as a wire, project the wire on Z=0 plane, then offset the projected wire by X mm (small compared to shell dimension, but might be not so small compared to shortest radius of the wire) within the plane.

I am stuck with the last part for making the offset. I have tried all classes that contain "Offset" in the name (BRepOffsetAPI_MakeOffset, BRepFill_OffsetWire, BRepOffsetAPI_MakeOffsetShape, etc), but in the best case I get only pieces of wire that do not form a closed loop.

The shell taken as input is read from a step file. It can be composed of several faces. It is NURBS. I can not assume much on the complexity/continuity of the shell. Only reasonable assumption is that it is a surface of moderated curvature (radius >> size) and is essentially horizontal. But for the wire itself, these assumptions do not really matter, we just know it lies on Z=0 plane after projection.

Basically what I need is the equivalent of "Offset" command in Rhino, that does exactly what I want and is very stable for the class of cases I am working on. What would be the best way to implement this type of command ? I am fine with implementing within opencascade code if needed.

If not possible to solve exactly that problem, it would be fine for my application to have an approximated solution. A work around I could think of is to build a "1D mesh" for the wire, composed of linear pieces, and use/develop an offset algorithm that works on this type of object instead of the more complex case of a wire composed of NURBS curves. But I am not sure if opencascade already provides the tools for this, or if there exist some opensource developments that could help me.

I would appreciate any hint that I could use to advance on this topic in the best direction.

Thank you.