View Issue Details

IDProjectCategoryView StatusLast Update
0027358CommunityOCCT:Shape Healingpublic2017-09-29 16:29
Reporterdrazmyslovich Assigned Tobugmaster  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2010 
Product Version6.8.0 
Target Version7.2.0Fixed in Version7.2.0 
Summary0027358: ShapeAnalysis_Curve::GetSamplePoints iteration logic isn't robust
DescriptionThe 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));
Steps To ReproduceNot applicable
TagsNo tags attached.
Test case numberNot needed

Activities

git

2016-04-06 10:31

administrator   ~0052419

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

gka

2016-04-25 18:12

developer   ~0053565

This modification is incorrect since the point for the last parameter added to the sequence twice.

git

2016-04-26 11:10

administrator   ~0053578

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

gka

2016-04-26 11:43

developer   ~0053584

Branch CR27358 is ready to be tested

git

2016-04-26 12:19

administrator   ~0053587

Branch CR27358 has been updated forcibly by mkv.

SHA-1: de860909ee259809e1994e05271090604f8fb579

mkv

2016-04-26 13:34

tester   ~0053592

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

mkv

2016-04-26 13:34

tester   ~0053593

Dear drazmyslovich,
Branch CR27358 has been rejected due to:
- compilation errors

git

2016-04-26 14:41

administrator   ~0053595

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

drazmyslovich

2016-04-26 14:49

developer   ~0053597

Sorry for compilation errors

gka

2016-04-28 15:24

developer   ~0053682

Branch CR27358 is ready to be tested

git

2016-04-29 13:45

administrator   ~0053730

Branch CR27358 has been updated forcibly by mkv.

SHA-1: de860909ee259809e1994e05271090604f8fb579

git

2016-04-29 16:58

administrator   ~0053743

Branch CR27358 has been updated forcibly by mkv.

SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237

mkv

2016-05-04 12:53

tester   ~0053789

Dear BugMaster,
Branch CR27358 was rebased on current master of occt git-repository.
SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237

mkv

2016-05-04 12:54

tester   ~0053790

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

mkv

2016-05-04 12:58

tester   ~0053791

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.

drazmyslovich

2016-05-11 15:29

developer   ~0053992

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

git

2016-09-12 13:52

administrator   ~0057684

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

drazmyslovich

2016-09-12 13:54

developer   ~0057685

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!

git

2017-08-14 17:00

administrator   ~0069363

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.

abv

2017-08-15 10:47

manager   ~0069372

The fix has been rebased on current master (branch CR27358_2), reviewed, and tested -- see job CR27358-master-abv. Please integrate

bugmaster

2017-08-15 12:10

administrator   ~0069379

Last edited: 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

git

2017-08-18 17:00

administrator   ~0069608

Branch CR27358 has been deleted by kgv.

SHA-1: aa2ebd4afb44efeaeaa70f81a0d9a70cf8033237

git

2017-08-18 17:00

administrator   ~0069609

Branch CR27358_1 has been deleted by kgv.

SHA-1: d4b19670feb8a84a08225a80da626ec333fca0e7

git

2017-08-18 17:00

administrator   ~0069610

Branch CR27358_2 has been deleted by kgv.

SHA-1: 73804cdf0fa5c5b94b98a88b09eb40482e4f3916

Related Changesets

occt: master 359cdde7

2016-09-12 10:52:36

razmyslovich


Committer: bugmaster Details Diff
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.
Affected Issues
0027358
mod - src/ShapeAnalysis/ShapeAnalysis_Curve.cxx Diff File

Issue History

Date Modified Username Field Change
2016-04-06 10:28 drazmyslovich New Issue
2016-04-06 10:28 drazmyslovich Assigned To => drazmyslovich
2016-04-06 10:31 git Note Added: 0052419
2016-04-06 10:32 drazmyslovich Assigned To drazmyslovich => gka
2016-04-06 10:32 drazmyslovich Status new => resolved
2016-04-06 10:32 drazmyslovich Steps to Reproduce Updated
2016-04-25 18:12 gka Note Added: 0053565
2016-04-25 18:12 gka Assigned To gka => drazmyslovich
2016-04-26 11:10 git Note Added: 0053578
2016-04-26 11:11 drazmyslovich Assigned To drazmyslovich => gka
2016-04-26 11:43 gka Note Added: 0053584
2016-04-26 11:43 gka Assigned To gka => bugmaster
2016-04-26 11:43 gka Status resolved => reviewed
2016-04-26 12:08 mkv Assigned To bugmaster => mkv
2016-04-26 12:19 git Note Added: 0053587
2016-04-26 13:34 mkv Note Added: 0053592
2016-04-26 13:34 mkv Note Added: 0053593
2016-04-26 13:34 mkv Assigned To mkv => drazmyslovich
2016-04-26 13:34 mkv Status reviewed => assigned
2016-04-26 13:35 mkv Test case number => Not needed
2016-04-26 14:41 git Note Added: 0053595
2016-04-26 14:49 drazmyslovich Note Added: 0053597
2016-04-26 14:49 drazmyslovich Assigned To drazmyslovich => gka
2016-04-26 14:49 drazmyslovich Status assigned => resolved
2016-04-28 15:24 gka Note Added: 0053682
2016-04-28 15:24 gka Assigned To gka => bugmaster
2016-04-28 15:24 gka Status resolved => reviewed
2016-04-28 16:43 mkv Assigned To bugmaster => mkv
2016-04-29 13:45 git Note Added: 0053730
2016-04-29 16:58 git Note Added: 0053743
2016-05-04 12:53 mkv Note Added: 0053789
2016-05-04 12:54 mkv Note Added: 0053790
2016-05-04 12:58 mkv Note Added: 0053791
2016-05-04 12:58 mkv Assigned To mkv => drazmyslovich
2016-05-04 12:58 mkv Status reviewed => assigned
2016-05-11 15:29 drazmyslovich Note Added: 0053992
2016-09-12 13:52 git Note Added: 0057684
2016-09-12 13:54 drazmyslovich Note Added: 0057685
2016-09-12 13:54 drazmyslovich Assigned To drazmyslovich => gka
2016-09-12 13:54 drazmyslovich Status assigned => resolved
2016-10-26 11:41 gka Target Version 7.1.0 => 7.2.0
2017-08-14 17:00 git Note Added: 0069363
2017-08-15 10:47 abv Note Added: 0069372
2017-08-15 10:47 abv Assigned To gka => bugmaster
2017-08-15 10:47 abv Status resolved => reviewed
2017-08-15 12:10 bugmaster Note Added: 0069379
2017-08-15 12:10 bugmaster Status reviewed => tested
2017-08-17 13:49 bugmaster Note Edited: 0069379
2017-08-18 12:53 bugmaster Changeset attached => occt master 359cdde7
2017-08-18 12:53 bugmaster Status tested => verified
2017-08-18 12:53 bugmaster Resolution open => fixed
2017-08-18 17:00 git Note Added: 0069608
2017-08-18 17:00 git Note Added: 0069609
2017-08-18 17:00 git Note Added: 0069610
2017-09-29 16:17 aiv Fixed in Version => 7.2.0
2017-09-29 16:29 aiv Status verified => closed