Hi,
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)
{
ptArr->SetValue(i,gp_Pnt(points[i].X(),points[i].Y(),points[i].Z()));
}
GeomAPI_Interpolate algo(ptArr,paramArr,Standard_True,0.000001);
algo.Perform();
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)
{
ptArr->SetValue(i,gp_Pnt(points[i].X(),points[i].Y(),points[i].Z()));
paramArr->SetValue(i,distance);
distance += (points[i+1] - points[i]).Length();
}
paramArr->SetValue(points.size()-1,distance);
GeomAPI_Interpolate algo(ptArr,paramArr,Standard_True,0.000001);
algo.Load(t,t);
algo.Perform();
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
Author