Closing a Geom_BSplineCurve

I am creating a Geom_BSplineCurve from a wire using GeomConvert_CompCurveToBSplineCurve. The wire is a valid closed wire and I am able to create the BSpline. However, it appears the BSpline is not fully closed. The start and end points of the BSpline are not within tolerance, they are off by a small amount.

My question: is there a way to adjust the BSpline so it is closed, such as something similar to ShapeFix_Wire?

Thanks for any suggestions.

cris_tst's picture

Does anybody have any help on this? I was hoping there was a way to fix this issue.

Roman Lygin's picture


You might want to ensure that start and end poles are coincident. For instance, something like:
Handle_Geom_BSplineCurve b = ...;
gp_Pnt aMidPoint = (b->FirstPoint() + b->EndPoint()).Coord() / 2.;
b->SetPole (1, aMidPoint);
b->SetPole (b->NbPoles, aMidPoint);
Hope this helps.

cris_tst's picture


I never thought to explicitly modify the first and last poles. As always your advice is great.

This does resolve the issue. By forcing the first and last poles to be coincident, the BSpline is fully closed.

Thanks again Roman.