Steps To Reproduce | Consider that the following code works:
#include "TColStd_HArray1OfReal.hxx"
#include "TColgp_HArray1OfPnt.hxx"
#include "GeomAPI_Interpolate.hxx"
#include "Geom_BSplineCurve.hxx"
#include "Geom_Circle.hxx"
int main()
{
Handle(TColgp_HArray1OfPnt) hardcoded_points {new TColgp_HArray1OfPnt(1, 4)};
(*hardcoded_points)[1] = {gp_Pnt(0, 0, 0)};
(*hardcoded_points)[2] = {gp_Pnt(1, 0, 0)};
(*hardcoded_points)[3] = {gp_Pnt(1.5, 0, 0)};
(*hardcoded_points)[4] = {gp_Pnt(4, 0, 0)};
GeomAPI_Interpolate interpolation(hardcoded_points, false, .01);
interpolation.Perform();
interpolation.IsDone();
Handle(Geom_BSplineCurve) interpolated_curve {interpolation.Curve()};
}
While the following code yields an exception:
#include "TColStd_HArray1OfReal.hxx"
#include "TColgp_HArray1OfPnt.hxx"
#include "GeomAPI_Interpolate.hxx"
#include "Geom_BSplineCurve.hxx"
#include "Geom_Circle.hxx"
int main()
{
Handle(TColgp_HArray1OfPnt) hardcoded_points {new TColgp_HArray1OfPnt(0, 3)};
(*hardcoded_points)[0] = {gp_Pnt(0, 0, 0)};
(*hardcoded_points)[1] = {gp_Pnt(1, 0, 0)};
(*hardcoded_points)[2] = {gp_Pnt(1.5, 0, 0)};
(*hardcoded_points)[3] = {gp_Pnt(4, 0, 0)};
GeomAPI_Interpolate interpolation(hardcoded_points, false, .01);
interpolation.Perform();
interpolation.IsDone();
Handle(Geom_BSplineCurve) interpolated_curve {interpolation.Curve()};
}
|
---|