View Issue Details

IDProjectCategoryView StatusLast Update
0025024CommunityOCCT:Foundation Classespublic2014-11-11 12:59
Reporterkhlebnikov Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Product Version6.7.1 
Target Version6.8.0Fixed in Version6.8.0 
Summary0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles
DescriptionWhen using GeomFill_SectionGenerator I came across a problem which would lead to an exception or incorrect results.
This seems to be due to a bug in BSplCLib::PrepareInsertKnots which returns incorrect number of poles if one of the inserted knots coincides with the last knot of the periodic spline in which the new knots are being inserted to.

It seems that there was some code regarding this problem, but it is commented out. If I uncomment it - the problem still persists.
However if I replace the line 1744 (sigma += amult - mult;) with the following snippet - it works OK in my cases.

---
    Line 1706: (add)
 
    Standard_Integer lastKnotMult = Mults(Knots.Upper());
---
    Line 1744: (replace sigma += amult - mult;)

    if (k == Knots.Upper() && Periodic) {
        lastKnotMult = Min(Degree, mult + 2 * (amult - mult));
        sigma += 2 * lastKnotMult - 2 * Mults(Knots.Lower());
    }
    else {
        sigma += amult - mult;
    }
---
   Line 1782: (replace NbPoles = sigma - Mults(Knots.Upper());)

   NbPoles = sigma - lastKnotMult;
---

In the attachment is a minimal example for the problem (only three simple wires - an ellipse and 2 circles in BSpline form) which when put into the GeomFill_SectionGenerator with AddCurve(BRep_Tool::Curve(edge, first, last)) would fail without and work with my changes.
I'm not sure whether my solution is correct, but it seems to work on many other more complex cases.
Steps To ReproduceLoad the wires from the attached files
Add them into GeomFill_SectionGenerator
Call GeomFill_SectionGenerator::Perform(1e-5)
TagsNo tags attached.
Test case numberbugs fclasses(002) bug25024

Attached Files

  • PrepareInsertKnots_Bug.zip (3,066 bytes)
  • BSplCLib.cxx (137,104 bytes)
  • bug25024_wires.brep (7,156 bytes)

Activities

khlebnikov

2014-06-18 22:31

developer  

PrepareInsertKnots_Bug.zip (3,066 bytes)

khlebnikov

2014-07-29 16:40

developer  

BSplCLib.cxx (137,104 bytes)

khlebnikov

2014-07-29 16:42

developer   ~0030474

I have added a more proper bugfix - it seems to work flawlessly for me - the fix I proposed originally doesn't work correctly in some cases. The attached file contains the necessary modifications both to PrepareInsertKnots and to InsertKnots. I didn't check it for the case where the "Add" flag is specified as it is of no interest for me now. The fix should be similar to the Add == false case.

abv

2014-08-12 10:00

manager   ~0030668

Last edited: 2014-08-12 10:01

DRAW reproducer:

restore bug25024_wires.brep w
explode w
thrusections r 0 0 w_1 w_2

Note that the problem is caused by wire w_1 when thusection works in "ruled" mode; the command works fine if w_3 is added, but fails again if second '0' is changed to '1' (ruled mode). Another problem with w_1 is that it cannot be displayed in axo viewer, perhaps because of edge range shifted w.r.t. the basis curve range.

abv

2014-08-12 10:01

manager  

bug25024_wires.brep (7,156 bytes)

git

2014-08-12 13:20

administrator   ~0030675

Branch CR25024 has been created by abv.

SHA-1: 658ec7243cc0e3b070d33534b03a2396a175b8f8


This branch includes the following new commits:

       new 658ec72 0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles


Detailed log of new commits:

commit 658ec7243cc0e3b070d33534b03a2396a175b8f8
Author: abv
Date: Tue Aug 12 13:20:08 2014 +0400

    0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles

abv

2014-08-12 13:21

manager   ~0030676

Proposed fix pushed to CR25024, please review

git

2014-08-13 13:03

administrator   ~0030713

Branch CR25024 has been updated by abv.

SHA-1: c5e8cbdab010f8cb9e92b9275d8c8e0e4a97e78f


      from 658ec72 0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles
       new c5e8cbd Added test bugs fclasses bug25024


Detailed log of new commits:

commit c5e8cbdab010f8cb9e92b9275d8c8e0e4a97e78f
Author: abv
Date: Wed Aug 13 13:03:25 2014 +0400

    Added test bugs fclasses bug25024

abv

2014-08-13 13:04

manager   ~0030714

I have run complete tests with this fix (vc10 x64); no regressions are reported

ifv

2014-08-14 11:55

developer   ~0030744

Ok

git

2014-08-15 12:31

administrator   ~0030773

Branch CR25024 has been updated forcibly by mkv.

SHA-1: 3da1afd014d2a672ffe7a4d6a32971918e253f72

mkv

2014-08-18 15:32

tester   ~0030838

Dear BugMaster,

Branch CR25024 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
SHA-1: 3da1afd014d2a672ffe7a4d6a32971918e253f72

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)

products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR25024-master-occt/Windows-32-VC10/bugs/fclasses/bug25024.html
bugs fclasses(002) bug25024: OK

Testing on Linux:
Total MEMORY difference: 351937856 / 351893124
Total CPU difference: 47990.08999999982 / 45953.80000000014

Testing on Windows:
Total MEMORY difference: 239618288 / 239728968
Total CPU difference: 33844.015625 / 32650.4375

There are no differences in images found by testdiff.

git

2014-08-18 15:32

administrator   ~0030839

Branch CR25024 has been updated by mkv.

SHA-1: f9b9c242cfadf6065cc1064ef1f7d95c3e1975b4


      from 3da1afd Added test bugs fclasses bug25024
       new f9b9c24 Test case for issue CR25024


Detailed log of new commits:

commit f9b9c242cfadf6065cc1064ef1f7d95c3e1975b4
Author: mkv
Date: Mon Aug 18 15:30:01 2014 +0400

    Test case for issue CR25024

git

2014-09-30 11:36

administrator   ~0032412

Branch CR25024 has been deleted by inv.

SHA-1: f9b9c242cfadf6065cc1064ef1f7d95c3e1975b4

Related Changesets

occt: master c1c03615

2014-09-25 08:47:03

khlebnikov


Committer: bugmaster Details Diff
0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles

Added test bugs fclasses bug25024
Affected Issues
0025024
mod - src/BSplCLib/BSplCLib.cxx Diff File
add - tests/bugs/fclasses/bug25024 Diff File

Issue History

Date Modified Username Field Change
2014-06-18 22:31 khlebnikov New Issue
2014-06-18 22:31 khlebnikov Assigned To => abv
2014-06-18 22:31 khlebnikov File Added: PrepareInsertKnots_Bug.zip
2014-07-29 16:40 khlebnikov File Added: BSplCLib.cxx
2014-07-29 16:42 khlebnikov Note Added: 0030474
2014-08-12 10:00 abv Note Added: 0030668
2014-08-12 10:00 abv Status new => assigned
2014-08-12 10:00 abv Target Version => 6.8.0
2014-08-12 10:01 abv File Added: bug25024_wires.brep
2014-08-12 10:01 abv Note Edited: 0030668
2014-08-12 13:20 git Note Added: 0030675
2014-08-12 13:21 abv Note Added: 0030676
2014-08-12 13:21 abv Assigned To abv => ifv
2014-08-12 13:21 abv Status assigned => resolved
2014-08-13 13:03 git Note Added: 0030713
2014-08-13 13:04 abv Note Added: 0030714
2014-08-14 11:55 ifv Note Added: 0030744
2014-08-14 11:55 ifv Status resolved => reviewed
2014-08-15 12:00 mkv Assigned To ifv => mkv
2014-08-15 12:31 git Note Added: 0030773
2014-08-18 15:32 mkv Note Added: 0030838
2014-08-18 15:32 git Note Added: 0030839
2014-08-18 15:32 mkv Test case number => bugs fclasses(002) bug25024
2014-08-18 15:32 mkv Assigned To mkv => bugmaster
2014-08-18 15:32 mkv Status reviewed => tested
2014-08-28 17:45 bugmaster Assigned To bugmaster => abv
2014-08-28 17:45 bugmaster Status tested => feedback
2014-09-19 19:32 abv Assigned To abv => bugmaster
2014-09-19 19:32 abv Status feedback => tested
2014-09-26 14:49 bugmaster Changeset attached => occt master c1c03615
2014-09-26 14:49 bugmaster Status tested => verified
2014-09-26 14:49 bugmaster Resolution open => fixed
2014-09-30 11:36 git Note Added: 0032412
2014-11-11 12:44 aiv Fixed in Version => 6.8.0
2014-11-11 12:59 aiv Status verified => closed