Smoothing a 2d polygon


I am quite new to OpenCASCADE and so far everything works very well for me.
However, I have a small task which I can't find a solution to.
Basically, I am using OpenCASCADE to create the BRep models for image-based vessel segmentation for further use in FEM simulation (for now it is made by creating a vessel path and specifying cross-sections which then go to ThruSections method to create the model).

What I want to do now is to use segmentation tools to output a polyline and use it lofting. It requires some smoothing though. So what I want to do is to fit a bspline curve to this polyline and minimize its curvature while controlling the approximation error (distance). Is there a class I could use for this purpose in OpenCASCADE? The closest thing that I found seems to be GeomPlate_MakeApprox, but I don't really see how I can use it for this particular task.

Could you please help me with this a little?

Thank you,

Rostislav Khlebnikov's picture

What I'm doing now is using Geom2dAPI_Interpolate to get the BSpline curve. Perhaps there's a way to smooth/simplify this BSpline curve with the same constraints I described before?