Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / create periodic curve from points

create periodic curve from points

create periodic curve from points
Marco 2013/02/12 13:09

I want to create a periodic curve from a list of points. I found the two algorithms GeomAPI_PointsToBSpline and GeomAPI_Interpolate.
I can create a curve with PointsToBSpline but I don't know how to make the curve periodic.
PointsToBSpline offers a parameter to make teh curve periodic, but the algorithm throws an exception when I use it. I don't know how to set the parameters proper. The doxygen documentation gives no further information how to set the parameters right. Any suggestions? How can I create periodic curve from a given list of points?

Best regards

Forum supervisor 2013/02/12 14:51
Dear Marco,
You should use GeomAPI_Interpolate algorithm with PeriodicFlag set to <True>.
In this case the curve will be periodic and closed, the junction point will be
the first point of the table Points. (See comments to the first constructor in

Marco 2013/02/15 13:44

I tried this, but it doesn't work. First I tried it like in the example code:

     Handle(TColgp_HArray1OfPnt) ptArr = new TColgp_HArray1OfPnt(0,points.size()-2);     
     for(unsigned int i = 0;i < points.size()-1;++i)
GeomAPI_Interpolate algo(ptArr,paramArr,Standard_True,0.000001);

But in this case the constructor throws an exception. Then I tried to add the parameters:
     Handle(TColgp_HArray1OfPnt) ptArr = new TColgp_HArray1OfPnt(0,points.size()-2);
     Handle(TColStd_HArray1OfReal) paramArr = new TColStd_HArray1OfReal(0,points.size()-1);
     for(unsigned int i = 0;i < points.size()-1;++i)

          distance += (points[i+1] - points[i]).Length();

     GeomAPI_Interpolate algo(ptArr,paramArr,Standard_True,0.000001);
Now the perform method throws an exception with an emtpy error message string. So I don't know whys it doesn't work.

Best regards

Forum supervisor 2013/02/15 15:09
Dear Marco,
If you have confidence that it is a bug
I would suggested you to register the issue in Mantis BugTracker
available at the development portal -
If the problem is critical for you, you may contact us via the Contact Form -
We will try to find a solution/workaround acceptable for you.
Marco 2013/02/20 10:50
I created a bug report. The code looks right I think, so I don't know why it should going wrong.

Is there another class which I can use for my goal?
Cauchy Ding 2013/09/17 11:17
Yes, GeomAPI_PointsToBSpline is a good and robust curve approximation API, but no period option available.
GeomAPI_Interpolate always throw exception when the input point array have too much points, it's not robust as expectation.
Benjamin Bihler 2014/02/21 14:28
Why is GeomAPI_Interpolate there, if is not so robust? Is it a general advise to use GeomAPI_PointsToBSpline instead?
Latest news
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map