View Issue Details

IDProjectCategoryView StatusLast Update
0033798CommunityOCCT:Modeling Algorithmspublic2024-08-17 10:32
Reporterformisliberating Assigned Todpasukhi  
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformMacOSOS 
Product Version7.8.0 
Summary0033798: Modeling Algorithms - Bug in GeomAPI_Interpolate::Perform()
DescriptionThe GeomAPI_Interpolate::Perform() member function does not handle 0-indexed collections of points properly. GeomAPI_Interpolate::Perform() raises a runtime exception of type Standard_OutOfRange when a 0-indexed array of points. This behavior is not documented anywhere.

Steps To ReproduceConsider 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()};
}
TagsNo tags attached.
Test case number

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2024-08-16 02:26 formisliberating New Issue
2024-08-16 02:26 formisliberating Assigned To => akaftasev
2024-08-16 10:49 dpasukhi Assigned To akaftasev =>
2024-08-16 10:49 dpasukhi Summary Bug in GeomAPI_Interpolate::Perform() => Modeling Algorithms - Bug in GeomAPI_Interpolate::Perform()
2024-08-16 10:49 dpasukhi Steps to Reproduce Updated
2024-08-17 10:32 dpasukhi Assigned To => dpasukhi