MantisBT - Community
View Issue Details
0027358Community[OCCT] OCCT:Shape Healingpublic2016-04-06 10:282017-09-29 16:29
drazmyslovich 
bugmaster 
normaltrivial 
closedfixed 
WindowsVC++ 201064 bit
[OCCT] 6.8.0 
[OCCT] 7.2.0[OCCT] 7.2.0 
Not needed
0027358: ShapeAnalysis_Curve::GetSamplePoints iteration logic isn't robust
The current iterating loop is

Standard_Real step = ( last - first ) / (Standard_Real)( nbs - 1 );
Standard_Real par = first, stop = last - 0.5 * step;
for ( ; par < stop; par += step )
  seq.Append(C.Value(par));
seq.Append(C.Value(last));

Such iterating isn't robust against some numerical errors appearing. Moreover for even smaller steps it can generate much more points, than nbs. Therefore it's proposed to use the following loop:

Standard_Real step = ( last - first ) / (Standard_Real)( nbs - 1 );
for (Standard_Integer i = 0; i < nbs; ++i)
  seq.Append(curve->Value(first + step * i));
seq.Append(curve->Value(last));
Not applicable
No tags attached.
Issue History
2016-04-06 10:28drazmyslovichNew Issue
2016-04-06 10:28drazmyslovichAssigned To => drazmyslovich
2016-04-06 10:31gitNote Added: 0052419
2016-04-06 10:32drazmyslovichAssigned Todrazmyslovich => gka
2016-04-06 10:32drazmyslovichStatusnew => resolved
2016-04-06 10:32drazmyslovichSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13407#r13407
2016-04-25 18:12gkaNote Added: 0053565
2016-04-25 18:12gkaAssigned Togka => drazmyslovich
2016-04-26 11:10gitNote Added: 0053578
2016-04-26 11:11drazmyslovichAssigned Todrazmyslovich => gka
2016-04-26 11:43gkaNote Added: 0053584
2016-04-26 11:43gkaAssigned Togka => bugmaster
2016-04-26 11:43gkaStatusresolved => reviewed
2016-04-26 12:08mkvAssigned Tobugmaster => mkv
2016-04-26 12:19gitNote Added: 0053587
2016-04-26 13:34mkvNote Added: 0053592
2016-04-26 13:34mkvNote Added: 0053593
2016-04-26 13:34mkvAssigned Tomkv => drazmyslovich
2016-04-26 13:34mkvStatusreviewed => assigned
2016-04-26 13:35mkvTest case number => Not needed
2016-04-26 14:41gitNote Added: 0053595
2016-04-26 14:49drazmyslovichNote Added: 0053597
2016-04-26 14:49drazmyslovichAssigned Todrazmyslovich => gka
2016-04-26 14:49drazmyslovichStatusassigned => resolved
2016-04-28 15:24gkaNote Added: 0053682
2016-04-28 15:24gkaAssigned Togka => bugmaster
2016-04-28 15:24gkaStatusresolved => reviewed
2016-04-28 16:43mkvAssigned Tobugmaster => mkv
2016-04-29 13:45gitNote Added: 0053730
2016-04-29 16:58gitNote Added: 0053743
2016-05-04 12:53mkvNote Added: 0053789
2016-05-04 12:54mkvNote Added: 0053790
2016-05-04 12:58mkvNote Added: 0053791
2016-05-04 12:58mkvAssigned Tomkv => drazmyslovich
2016-05-04 12:58mkvStatusreviewed => assigned
2016-05-11 15:29drazmyslovichNote Added: 0053992
2016-09-12 13:52gitNote Added: 0057684
2016-09-12 13:54drazmyslovichNote Added: 0057685
2016-09-12 13:54drazmyslovichAssigned Todrazmyslovich => gka
2016-09-12 13:54drazmyslovichStatusassigned => resolved
2016-10-26 11:41gkaTarget Version7.1.0 => 7.2.0
2017-08-14 17:00gitNote Added: 0069363
2017-08-15 10:47abvNote Added: 0069372
2017-08-15 10:47abvAssigned Togka => bugmaster
2017-08-15 10:47abvStatusresolved => reviewed
2017-08-15 12:10bugmasterNote Added: 0069379
2017-08-15 12:10bugmasterStatusreviewed => tested
2017-08-17 13:49bugmasterNote Edited: 0069379bug_revision_view_page.php?bugnote_id=69379#r17335
2017-08-18 12:53bugmasterChangeset attached => occt master 359cdde7
2017-08-18 12:53bugmasterStatustested => verified
2017-08-18 12:53bugmasterResolutionopen => fixed
2017-08-18 17:00gitNote Added: 0069608
2017-08-18 17:00gitNote Added: 0069609
2017-08-18 17:00gitNote Added: 0069610
2017-09-29 16:17aivFixed in Version => 7.2.0
2017-09-29 16:29aivStatusverified => closed

Notes
(0052419)
git   
2016-04-06 10:31   
Branch CR27358 has been created by drazmyslovich.

SHA-1: 0a806c69bd2f5b4c2e42bc6e67af30a46ce3dbb8


Detailed log of new commits:

Author: razmyslovich
Date: Wed Apr 6 09:30:58 2016 +0200

    Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust
(0053565)
gka   
2016-04-25 18:12   
This modification is incorrect since the point for the last parameter added to the sequence twice.
(0053578)
git   
2016-04-26 11:10   
Branch CR27358 has been updated by drazmyslovich.

SHA-1: 559b91dce482cc25ff176607d318ba64cfd239b5


Detailed log of new commits:

Author: razmyslovich
Date: Tue Apr 26 10:10:36 2016 +0200

    0027358: Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust - fix the points number

(0053584)
gka   
2016-04-26 11:43   
Branch CR27358 is ready to be tested
(0053587)
git   
2016-04-26 12:19   
Branch CR27358 has been updated forcibly by mkv.

SHA-1: de860909ee259809e1994e05271090604f8fb579
(0053592)
mkv   
2016-04-26 13:34   
Dear BugMaster,
Branch CR27358 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: de860909ee259809e1994e05271090604f8fb579

There are following compilation errors:
Linux:
http://jenkins-test-07.nnov.opencascade.com:8080/view/CR27358-master/job/CR27358-master-OCCT-Debian70-64-opt-compile/1/parsed_console/ [^]
/dn54/builds/CR27358-master/Debian70-64-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1035:60: error: 'nbs' was not declared in this scope

Windows:
http://jenkins-test-07.nnov.opencascade.com:8080/view/CR27358-master/job/CR27358-master-OCCT-Windows-64-VC10-opt-compile/1/parsed_console/ [^]
19>..\..\..\src\ShapeAnalysis\ShapeAnalysis_Curve.cxx(1035): error C2065: 'nbs' : undeclared identifier
19>..\..\..\src\ShapeAnalysis\ShapeAnalysis_Curve.cxx(1036): error C2065: 'nbs' : undeclared identifier

MacOS:
http://jenkins-test-07.nnov.opencascade.com:8080/view/CR27358-master/job/CR27358-master-OCCT-MacOS-opt-compile/1/parsed_console/ [^]
[ 33%] /Users/mnt/builds/CR27358-master/MacOS-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1035:60: error: use of undeclared identifier 'nbs'; did you mean 'nbp'?
  Standard_Real step = ( last - first ) / (Standard_Real)( nbs - 1 );
                                                           ^~~
                                                           nbp


/Users/mnt/builds/CR27358-master/MacOS-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1036:36: error: use of undeclared identifier 'nbs'; did you mean 'nbp'?
  for (Standard_Integer i = 0; i < nbs - 1; ++i)
                                   ^~~
                                   nbp
(0053593)
mkv   
2016-04-26 13:34   
Dear drazmyslovich,
Branch CR27358 has been rejected due to:
- compilation errors
(0053595)
git   
2016-04-26 14:41   
Branch CR27358 has been updated by drazmyslovich.

SHA-1: 782ea768b7a3a21f6493b1bc5f425aa3522e09aa


Detailed log of new commits:

Author: razmyslovich
Date: Tue Apr 26 13:41:08 2016 +0200

    Merge branch 'CR27358' of git.dev.opencascade.org:occt into CR27358
    
    Conflicts:
        src/ShapeAnalysis/ShapeAnalysis_Curve.cxx

Author: razmyslovich
Date: Tue Apr 26 13:29:15 2016 +0200

    0027358: Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust - clean build

Author: razmyslovich
Date: Tue Apr 26 13:13:13 2016 +0200

    0027358: Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust - clean build

Author: razmyslovich
Date: Tue Apr 26 10:10:36 2016 +0200

    0027358: Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust - fix the points number

Author: razmyslovich
Date: Wed Apr 6 09:30:58 2016 +0200

    Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust

(0053597)
drazmyslovich   
2016-04-26 14:49   
Sorry for compilation errors
(0053682)
gka   
2016-04-28 15:24   
Branch CR27358 is ready to be tested
(0053730)
git   
2016-04-29 13:45   
Branch CR27358 has been updated forcibly by mkv.

SHA-1: de860909ee259809e1994e05271090604f8fb579
(0053743)
git   
2016-04-29 16:58   
Branch CR27358 has been updated forcibly by mkv.

SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237
(0053789)
mkv   
2016-05-04 12:53   
Dear BugMaster,
Branch CR27358 was rebased on current master of occt git-repository.
SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237
(0053790)
mkv   
2016-05-04 12:54   
Dear BugMaster,
Branch CR27358 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237

There are following compilation errors:
Linux:
http://jenkins-test-07.nnov.opencascade.com:8080/view/CR27358-master/job/CR27358-master-OCCT-Debian70-64-opt-compile/1/parsed_console/ [^]
/dn54/builds/CR27358-master/Debian70-64-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1035:60: error: 'nbs' was not declared in this scope

Windows:
http://jenkins-test-07.nnov.opencascade.com:8080/view/CR27358-master/job/CR27358-master-OCCT-Windows-64-VC10-opt-compile/1/parsed_console/ [^]
19>..\..\..\src\ShapeAnalysis\ShapeAnalysis_Curve.cxx(1035): error C2065: 'nbs' : undeclared identifier
19>..\..\..\src\ShapeAnalysis\ShapeAnalysis_Curve.cxx(1036): error C2065: 'nbs' : undeclared identifier

MacOS:
http://jenkins-test-07.nnov.opencascade.com:8080/view/CR27358-master/job/CR27358-master-OCCT-MacOS-opt-compile/1/parsed_console/ [^]
/Users/mnt/builds/CR27358-master/MacOS-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1035:60: error: use of undeclared identifier 'nbs'; did you mean 'nbp'?
  Standard_Real step = ( last - first ) / (Standard_Real)( nbs - 1 );
                                                           ^~~
                                                           nbp
/Users/mnt/builds/CR27358-master/MacOS-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1009:20: note: 'nbp' declared here
  Standard_Integer nbp =100*aK;
                   ^
/Users/mnt/builds/CR27358-master/MacOS-opt/OCCT/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx:1036:36: error: use of undeclared identifier 'nbs'; did you mean 'nbp'?
  for (Standard_Integer i = 0; i < nbs - 1; ++i)
                                   ^~~
                                   nbp
(0053791)
mkv   
2016-05-04 12:58   
Dear drazmyslovich,
Branch CR27358 has been rejected due to:
- compilation errors

Dear drazmyslovich,
could you please use "Rebase..." function of TortoiseGit, do not use "Merge..." function.
(0053992)
drazmyslovich   
2016-05-11 15:29   
Dear mkv,
sorry for this mess, I'm not using git that often...
Could you please still help me to commit my changes correctly?
My current local copy is switched to the branch. I did git->rebase, upstream: master. There were a couple of conflicts, but it worked fine, I pushed commit at the end and done. Now I would like to commit and push the correct file, but the change list is empty and commit is impossible. Did I something wrong? Should I just push now the changes.
Thanks in advance!
Regards,
Dima
(0057684)
git   
2016-09-12 13:52   
Branch CR27358_1 has been created by drazmyslovich.

SHA-1: d4b19670feb8a84a08225a80da626ec333fca0e7


Detailed log of new commits:

Author: razmyslovich
Date: Mon Sep 12 12:52:36 2016 +0200

    0027358: Make the iterating logic in ShapeAnalysis_Curve::GetSamplePoints more robust - rebased

Author: razmyslovich
Date: Mon Sep 12 11:17:48 2016 +0200

    0027863: Fix Geom_BSplineSurface::SetVKnot function
(0057685)
drazmyslovich   
2016-09-12 13:54   
Since my tries to make a rebase in the original branch were unsuccessful, I finally created a new branch using the current master state. Please, review the changes. Thank you!
(0069363)
git   
2017-08-14 17:00   
Branch CR27358_2 has been created by abv.

SHA-1: 73804cdf0fa5c5b94b98a88b09eb40482e4f3916


Detailed log of new commits:

Author: razmyslovich
Date: Mon Sep 12 12:52:36 2016 +0200

    0027358: ShapeAnalysis_Curve::GetSamplePoints iteration logic isn't robust
    
    The iterating logic in ShapeAnalysis_Curve::GetSamplePoints() is made more robust: instead of iterative incrementing parameter by adding step, parameter at each point is calculated independently from index.
    This avoids possible accumulation of numeric errors, and ensures that generated points are equally spaced and their quantity is respected in all cases.
(0069372)
abv   
2017-08-15 10:47   
The fix has been rebased on current master (branch CR27358_2), reviewed, and tested -- see job CR27358-master-abv. Please integrate
(0069379)
bugmaster   
2017-08-15 12:10   
(edited on: 2017-08-17 13:49)
Combination -
OCCT branch : CR27358_2 : SHA-1: 73804cdf0fa5c5b94b98a88b09eb40482e4f3916
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

http://jenkins-test-10.nnov.opencascade.com/view/CR27358-master-abv/view/START%20BRANCH%20CERTIFICATION/ [^]

Number of compiler warnings:

OCCT :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Products :
Linux: 5 (5 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:

Windows:
OCCT
Total CPU difference: 17276.112343598714 / 17295.75286949859 [-0.11%]
Producst
Total CPU difference: 7737.477998899967 / 7720.302288799964 [+0.22%]

Linux:
OCCT
Total CPU difference: 19493.150000000118 / 19456.560000000376 [+0.19%]
Products
Total CPU difference: 7727.790000000094 / 7725.120000000072 [+0.03%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

(0069608)
git   
2017-08-18 17:00   
Branch CR27358 has been deleted by kgv.

SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237
(0069609)
git   
2017-08-18 17:00   
Branch CR27358_1 has been deleted by kgv.

SHA-1: d4b19670feb8a84a08225a80da626ec333fca0e7
(0069610)
git   
2017-08-18 17:00   
Branch CR27358_2 has been deleted by kgv.

SHA-1: 73804cdf0fa5c5b94b98a88b09eb40482e4f3916