View Issue Details

IDProjectCategoryView StatusLast Update
0023050CommunityOCCT:Modeling Datapublic2012-04-02 13:33
ReporterAhmed Sherif Assigned Tojgv 
PriorityhighSeveritycrash 
Status assignedResolutionopen 
PlatformWindowsOSVC++ 2010 
Product Version6.5.1 
Target VersionUnscheduled 
Summary0023050: Geom2d_BSplineCurve InsertPoleAfter
DescriptionFile Geom2d_BSplineCurve.cxx, line 539.
function InsertPoleAfter(const Standard_Integer Index,
 const gp_Pnt2d& P,
 const Standard_Real Weight) ;

calling this method cause a run time error.
1- at line 561 the for loop:(wrong implementation)
for (i = 1; i < nbknots; i++) {
    newknots (i) = cknots(i);
  }

2- at line 565:(wrong implementation)
newknots (nbknots+1) = 2 * newknots (nbknots) - newknots(nbknots-1);
since newknots just holding a garbage.

3- at line 575:(run time error)
newmults (nbknots+1) = cmults(nbknots+1);
at this line causes a run time error because (cmults size = nbknots) and access
cmults(nbknots+1) makes an error.

Solution:
1- for (i = 1; i <= nbknots; i++) { //changed from < only to <=
    newknots (i) = cknots(i);
  }

2- newknots (nbknots+1) = 2 * cknots (nbknots) - cknots(nbknots-1);
// instead of newknots

3- newmults (nbknots+1) = cmults(nbknots); // instead of +1
Additional information
and documentation updates
- I found this bug at November 2011, sorry for delay.
- For method IncreaseDegree at Geom2d_BSplineCurve it calls static method
IncreassDegree from BSplCLib while the BSplCLib cdl file documented that you use this method only for BezierCurve. so what kind of BsplineCurve I need to test that method because it gives run time error sometimes as well or garbage results.
Thanks in advance.

       Ahmed Sherif
  
TagsNo tags attached.
Test case number

Activities

abv

2012-04-02 13:32

manager   ~0020236

Note that method InsertPoleAfter() of Geom2d_BSplineCurve is not used anywhere in OCCT; even tests call only corresponding methods of bezier curves (see GeomliteTest_CurveCommands.cxx, command insertpole). Thus we need to extend this command for testing this function, and create a test case, before integrating the fix.

The general question is whether this method is needed for bspline at all. In bezier curves, it adds a pole by increasing degree, and this is the only way to add more degrees of freedom for bezier. In bspline, adding degrees of freedom should be rather achieved by calling InsertKnots().

Issue History

Date Modified Username Field Change
2012-03-31 14:18 Ahmed Sherif New Issue
2012-03-31 14:18 Ahmed Sherif Assigned To => jgv
2012-04-02 13:32 abv Note Added: 0020236
2012-04-02 13:32 abv Status new => assigned
2012-04-02 13:33 abv Target Version => Unscheduled