# closed surface

hello all,

I saw someone already brought up this question, but never get answered. How to build a closed surface from points to bspline surface.

Here is the problem:

Handle(Geom_BSplineSurface) surf = PointsToBSplineSurface(pnt);
surf->SetUPeriodic;

This seems right, and it changes the logical value of U or V direction periodic to TRUE in the STEP file I created. But the result is never correct.

It's not so simple? Or there is something missed?
Thank you, Hi,
it is not egnough to set the periodic flag, you also have to manipulate the "multiplicities". I did it for the BSpline curve, it should be the same for the surface. I could send you or post a piece of code (although written in C#)
best regards
Gerhard Please do that, I guess the one for the curve will be helpful. Please do that, I guess the one for the curve will be helpful.

thank you very much Hello Han,
this is my code, I am not sure, whether it works in your scenario:

if (multiplicities>degree) multiplicities = degree-1;
multiplicities[multiplicities.Length-1] = multiplicities;
int sum = 0;
for (int i=0; ipoles.Length)
{
if (multiplicities[j]>1)
{
--sum;
--multiplicities[j];
}
if (sum>poles.Length)
{
if (multiplicities[multiplicities.Length-1-j]>1)
{
--sum;
--multiplicities[multiplicities.Length-j];
}
}
++j;
if (j>multiplicities.Length/2) j = 0;
}
while (summultiplicities.Length/2) j = 1;
}
multiplicities[multiplicities.Length-1] = multiplicities;