Problems creating BSpline over points

Hi

I am trying to create a BSpline curve over some points but I am getting a very bad shape and the points are not joined properly. I have attached a file which shows the problem.

Plz give any suggestions about the reasom of the problem. Is it due to any predefined constraints?

Attachments: 
Nitin's picture

Hi

I am able to join the points upto a certain limit after which the figure distorts. What can I do to join all the points and still get a smooth curve.
I have attached two more pictures in which the distortion is visible on joining more points.

Regards

Attachments: 
Thomas Paviot's picture

Hi Nitin,

The picture looks like an attempt to produce a naca profile. We already experimented such a test at pythonOCC. Attached a python script naca_profile.py that can help you.

The function interopolate_points_to_spline_no_tangency, which uses the GeomAPI_Interpolate class, can be studied at http://code.google.com/p/pythonocc/source/browse/trunk/src/addons/Utils/....

Regards,

Thomas

Attachments: 
Thomas Paviot's picture

Second attachement: screenshot of the expected result.

Thomas

Nitin's picture

Hi Thomas

Yes I am trying to build an aircraft model. I did get the shape by splitting the curves into 4 splines and then joining them. But I think using the linear interpolation code you mentioned will make the code more compact. Thanks.

Regards
Nitin

Nitin's picture

Hi Thomas

I tried using the GeomAPI_Interpolate class to perform the interpolation. My code is as follows:

Handle(TColgp_HArray1OfPnt) endarray13 = new TColgp_HArray1OfPnt(1,21);
endarray->SetValue(1,A);
.
.
.
Handle(Geom_BSplineCurve) SPL15 = GeomAPI_Interpolate(endarray13, Standard_False,
0.01).Curve();
WingCurve14 = BRepBuilderAPI_MakeEdge(SPL15);
WingWire14 = BRepBuilderAPI_MakeWire(WingCurve14);

Handle(AIS_Shape) red14 = new AIS_Shape(WingWire14);
myAISContext->Display(red14,Standard_False);

This compiles successfully but gives this error:
008FE504: Standard_ConstructionError

Plz suggest how I can solve this problem. thanks.
Regards
Nitin