Sat, 01/26/2013 - 17:13

Hi,

I have the following situation. I load some points which describes closed curves. I give the points to the PointsToBSpline algorithm to get the curve.

TColgp_Array1OfPnt arr(0,points.size()-1);

for(unsigned int i = 0;i {

arr.SetValue(i,gp_Pnt(points[i].X(),points[i].Y(),points[i].Z()));

}

auto spline = GeomAPI_PointsToBSpline(arr,3,8,GeomAbs_C2,0.00001);

spline.Curve()->SetPeriodic();

return spline;

Here I have a first question. Is it necessary that the last point is identical to the first point so that opencascade really makes a closed curve?

Then I create egdes and wires from the b spline curves. That works fine.

And now the more import question for me. I want co create a face (and later a solid) from these curves, the first step is to create a face which are limited by two of such closed curves. The MakeFace algorithm doesn't work because it works with planar edges.

SO, how can create a face from two given closed b spline curves?

Best regards

Marco

Mon, 01/28/2013 - 16:35

Any suggestions?

Mon, 01/28/2013 - 21:27

1. For sure to have a closed spline, the last point must be coincident with the first.

2. Maybe you can use BRepFill_Filling with the outer wire to create a face and then split it with the inner one, using BRepFeat_SplitShape.

Ciao.

Mauro

Mon, 01/28/2013 - 23:51

I tested a little bit with BRepFill_Filling, but it crashes.

Is there really no algorithm to get a surface from two curves? I read the pdf's from the documentation folder and also found nothing :(

Any other suggestions?

Tue, 01/29/2013 - 01:34

So, I tested it with GeomFill_BSplineCurves, that alorithm works better (see attached image)

As you can see there are some errors at the connecting line.

One problem is still left: the algorithm only works if the flag SetPeriodic isn't set.

If I use "spline.Curve()->SetPeriodic();" than the allgorithm crashes during runtime! Therefore, my resulting faces are not really periodic. It looks only so.

That is the code for the spline creation:

TColgp_Array1OfPnt arr(0,points.size()-1);

for(unsigned int i = 0;i < points.size();++i)

{

arr.SetValue(i,gp_Pnt(points[i].X(),points[i].Y(),points[i].Z()));

}

auto spline = GeomAPI_PointsToBSpline(arr,2,7,GeomAbs_C1,0.00001);

First and last point in the array are identical! Did I something wrong?

Tue, 02/05/2013 - 20:20

*push*

still unsolved

Tue, 07/09/2013 - 19:03

I always used GeomAPI_Interpolate for my splines. The constructor of this class takes a periodic flag!

Fri, 07/12/2013 - 15:43

For creating a face from 2 curves you can also use

BRepFill.Face(const TopoDS_Edge &Edge1, const TopoDS_Edge &Edge2)

You might also have a look at BRepOffsetAPI_ThruSections.

Thu, 03/28/2019 - 12:59

I am having similar query. I have set of points in 3D space from which I want to create closed bSpline face. The CreateFace api only returns planar faces. if the points make up a curved face like a bspline it eturns null?

How can i achieve this? any help would be appreciated.

Tue, 09/03/2019 - 13:24

Hi,

If this is still a matter to you, you should check out the

MakeApprox API with theexample given there: https://dev.opencascade.org/doc/overview/html/occt_user_guides__modeling_algos.html#occt_modalg_2_5_5. It gave me acceptable results to fill a face constrained by a loop of 4 B-splines curves.Regards,

Julien