View Issue Details

IDProjectCategoryView StatusLast Update
0025635Open CASCADEOCCT:Modeling Algorithmspublic2015-05-14 15:32
ReporternbvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version6.9.0Fixed in Version6.9.0 
Summary0025635: Wrong result of 2D-extrema between two ellipsis
DescriptionTwo ellipsis are tangent each other. Therefore, extrema must be 2d-Point. However, we have another result (see SCRIPT # 1).

More over, case with 2D-point processed wrong by 2d-extrema command (see SCRIPT # 2). It is a bug of DRAW-command only (extremas are computed properly).
Steps To ReproduceSCRIPT # 1

Draw[]> ellipse c1 0 0 2 1
Draw[]> ellipse c2 4 0 2 1

Draw[]> 2dextr c1 c2
#dist 1: 0.32979086888313447
#ext_1

Draw[]> dump ext_1
#Result is wrong

############################################
SCRIPT # 2

Draw[]> circle c1 0 0 2
Draw[]> circle c2 4 0 2

Draw[]> 2dextr c1 c2
#dist 1: 4
#ext_1 dist 2: 0
#dist 3: 8
#ext_3 dist 4: 4
#ext_4

Draw[]> dump ext_2
#Empty result.

However, ext_2 exists. It is marked only (in the picture of 2D-viewer).

Draw[]> v2d
Draw[]> 2dfit
TagsNo tags attached.
Test case numberbugs fclasses(002) bug25635_1, bug25635_2

Relationships

related to 0025593 closedbugmaster Open CASCADE Number of intersection points for 2d curves depends on the order of arguments in command "2dintersect" 

Activities

git

2014-12-22 14:49

administrator   ~0035554

Branch CR25635 has been created by aml.

SHA-1: d12276424a04ad41d6b87b0bdbbbd6d33aed4f09


Detailed log of new commits:

Author: aml
Date: Mon Dec 22 14:48:58 2014 +0300

    0025635: Wrong result of 2D-extrema between two ellipsis
    
    Fixed Lipschitz constant evaluation in case co-parametrized objects.
    Fixed 2dextrema output.
    Testcase update to new behaviour.

aml

2014-12-22 14:50

developer   ~0035555

Dear abv,
Please check current state of branch CR25635.

abv

2014-12-24 00:22

manager   ~0035638

Minor remarks on performance and robustness in math_GlobOptMin::computeInitialValues():

- there seem to be no protection against situation if myA == myB, in that case aStep would become 0 and it still serves as divisor

- aPrevVal is not reset before second cycle, should not it be?

- second cycle is not symmetric w.r.t. the order of variables, should not it be?

- division by aStep seems to be not really necessary in cycles, this may be done once at the end

- Value (myB - myA) / (aPntNb - 1) could be calculated once and then reused in each cycle. It seems that '- 1' is not needed here, and that value should be consistent with how aStep is calculated.

- arguments calculated in condition of "if"s in "for" cycles at lines 317 and 332 are used in their bodies; it is better to calculate the value once.
For both performance and clarity it might be better to write something like

aLipConst = Max (aLipConst, Abs(aCurrVal - aPrevVal))

instead of "if" (operator "?" works faster than "if" from my experience)

git

2014-12-24 09:55

administrator   ~0035648

Branch CR25635 has been updated forcibly by aml.

SHA-1: b0af211a85aa57732e9aa5b94768d85320c70a15

aml

2014-12-24 10:06

developer   ~0035649

Dear abv,

"second cycle is not symmetric w.r.t. the order of variables, should not it be?"
Yes, cycle is not symmetric and it is correct.

Another remarks are fixed.

Please check updated branch CR25635.

abv

2014-12-24 21:24

manager   ~0035691

Alexander, please explain the formula used to calculate aCurrPnt:

  for(i = 1; i <= aPntNb; i++)
  {
    aCurrPnt = myA + (myB - myA) * i / (aPntNb - 1);
    ...
  }

At the last iteration i = aPntNb and aCurrPnt is NOT equal to myB, while it should be, if my understanding is correct. See relevant point in my previous comment.

git

2014-12-25 08:00

administrator   ~0035693

Branch CR25635 has been updated forcibly by aml.

SHA-1: 77e280a6b5a674476c92944d7d4c526b92201e07

git

2014-12-25 09:31

administrator   ~0035696

Branch CR25635 has been updated forcibly by aml.

SHA-1: 97b74f1fede13f654ce4c61c6a64eafbf80296ea

aml

2014-12-25 10:06

developer   ~0035704

Dear abv,
I forgot to add this part of fix. As we discussed "(myB - myA) / aPntNb" computation moved out of cycle.

Please check branch CR25635.

abv

2014-12-25 15:14

manager   ~0035722

Reviewed, please test.

P.S. Though, "aStep = aParamStep.Norm();" :)

mkv

2014-12-30 17:45

tester   ~0035909

Dear BugMaster,
Branch CR25635 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: 97b74f1fede13f654ce4c61c6a64eafbf80296ea

Number of compiler warnings:

occt component :
Linux: 18 (18 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.nnov.opencascade.com/CR25635-master-occt/Windows-32-VC10/bugs/fclasses/bug25635_1.html
bugs fclasses(002) bug25635_1: OK
http://occt-tests.nnov.opencascade.com/CR25635-master-occt/Windows-32-VC10/bugs/fclasses/bug25635_2.html
bugs fclasses(002) bug25635_2: OK

Testing on Linux:
occt component :
Total MEMORY difference: 367337528 / 367924740
Total CPU difference: 50018.94999999995 / 51486.81000000016
products component :
Total MEMORY difference: 113173680 / 113199648
Total CPU difference: 16686.53999999996 / 17027.049999999977

Testing on Windows:
occt component :
Total MEMORY difference: 277698124 / 277270364
Total CPU difference: 38541.03125 / 37471.9842007
products component :
Total MEMORY difference: 72394772 / 71382268
Total CPU difference: 10750.578125 / 10342.656534399997

There are no differences in images found by testdiff.

git

2014-12-30 17:45

administrator   ~0035910

Branch CR25635 has been updated by mkv.

SHA-1: 2519596b1bc737b3d394a899ae4c9c2790359436


Detailed log of new commits:

Author: mkv
Date: Tue Dec 30 17:43:46 2014 +0300

    Test cases for issue CR25635

mkv

2014-12-30 17:46

tester   ~0035911

Dear aml,
could you please review test case bugs/fclasses(002)/bug25635_1 and bugs/fclasses(002)/bug25635_2

aml

2015-01-12 08:35

developer   ~0035937

Dear mkv,

bug25635_1
Please follow nbv comments.

bug25635_2
Second test should check output order:

master:
"dist 1: 4
ext_1 dist 2: 0
dist 3: 8
ext_3 dist 4: 4
ext_4"

after fix:

"dist 1: 4 ext_1
 dist 2: 0 ext_2
 dist 3: 8 ext_3
 dist 4: 4 ext_4"

ext_2 added to output and "dist i / ext_i" now on one line.

1) Check existence of each ext_i in "2dextrema" command output.

git

2015-02-04 17:11

administrator   ~0037082

Branch CR25635 has been updated by mkv.

SHA-1: 955c25d41bbc555874d18b4e3ced1484cc014437


Detailed log of new commits:

Author: mkv
Date: Wed Feb 4 17:08:26 2015 +0300

    Correction of test cases for issue CR25635

mkv

2015-02-04 17:12

tester   ~0037083

Dear aml,
could you please review test case bugs/fclasses(002)/bug25635_1 and bugs/fclasses(002)/bug25635_2

http://occt-tests/CR25635-master-occt/Windows-32-VC10/bugs/fclasses/bug25635_1.html
http://occt-tests/CR25635-master-occt/Windows-32-VC10/bugs/fclasses/bug25635_2.html

aml

2015-02-05 12:00

developer   ~0037103

Dear mkv,

I
First test case is OK.

II
In the second test case distance value strictly associated with extrema. It's not good since output order may change from time to time. For example if swap first and second extrema in output, testcase will fail:

"dist 1: 0 ext_1
 dist 2: 4 ext_2
 dist 3: 8 ext_3
 dist 4: 4 ext_4"

It is better to make regular expressions which check existence of each ext_i. For example:

if { [regexp {ext_1}} ${info}] } {
  puts "OK: Good ext_1"
} else {
  puts "Error: Wrong ext_1"
}

This will be enough.

git

2015-02-05 14:28

administrator   ~0037118

Branch CR25635 has been updated by mkv.

SHA-1: 8208da0c97aa5a6c8c3de048e1d1c1c8ccf2447c


Detailed log of new commits:

Author: mkv
Date: Thu Feb 5 14:28:01 2015 +0300

    Correction of test case for issueCR25635

mkv

2015-02-05 14:29

tester   ~0037119

Branch CR25635 is TESTED.

git

2015-03-18 13:34

administrator   ~0038536

Branch CR25635 has been deleted by inv.

SHA-1: 8208da0c97aa5a6c8c3de048e1d1c1c8ccf2447c

Related Changesets

occt: master e8746a26

2015-02-05 13:13:39

aml


Committer: bugmaster Details Diff
0025635: Wrong result of 2D-extrema between two ellipsis

Fixed Lipschitz constant evaluation in case co-parametrized objects.
Fixed 2dextrema output.
Testcase update to new behavior.

Test cases for issue CR25635

Correction of test cases for issue CR25635
Affected Issues
0025635
mod - src/GeomliteTest/GeomliteTest_API2dCommands.cxx Diff File
mod - src/math/math_GlobOptMin.cxx Diff File
add - tests/bugs/fclasses/bug25635_1 Diff File
add - tests/bugs/fclasses/bug25635_2 Diff File
mod - tests/bugs/moddata_1/buc60890 Diff File

Issue History

Date Modified Username Field Change
2014-12-22 10:18 nbv New Issue
2014-12-22 10:18 nbv Assigned To => aml
2014-12-22 10:24 nbv Description Updated
2014-12-22 10:31 nbv Relationship added related to 0025593
2014-12-22 14:49 git Note Added: 0035554
2014-12-22 14:50 aml Note Added: 0035555
2014-12-22 14:50 aml Assigned To aml => abv
2014-12-22 14:50 aml Status new => resolved
2014-12-24 00:22 abv Note Added: 0035638
2014-12-24 00:22 abv Assigned To abv => aml
2014-12-24 00:22 abv Status resolved => assigned
2014-12-24 09:55 git Note Added: 0035648
2014-12-24 10:06 aml Note Added: 0035649
2014-12-24 10:06 aml Assigned To aml => abv
2014-12-24 10:06 aml Status assigned => resolved
2014-12-24 21:24 abv Note Added: 0035691
2014-12-24 21:24 abv Assigned To abv => aml
2014-12-24 21:24 abv Status resolved => feedback
2014-12-25 08:00 git Note Added: 0035693
2014-12-25 09:31 git Note Added: 0035696
2014-12-25 10:06 aml Note Added: 0035704
2014-12-25 10:06 aml Assigned To aml => abv
2014-12-25 10:06 aml Status feedback => resolved
2014-12-25 15:14 abv Note Added: 0035722
2014-12-25 15:14 abv Assigned To abv => bugmaster
2014-12-25 15:14 abv Status resolved => reviewed
2014-12-25 15:53 mkv Assigned To bugmaster => mkv
2014-12-30 17:45 mkv Note Added: 0035909
2014-12-30 17:45 git Note Added: 0035910
2014-12-30 17:46 mkv Note Added: 0035911
2014-12-30 17:46 mkv Assigned To mkv => aml
2014-12-30 17:46 mkv Status reviewed => feedback
2014-12-30 17:46 mkv Test case number => bugs fclasses(002) bug25635_1, bug25635_2
2014-12-30 17:53 nbv Assigned To aml => nbv
2014-12-30 17:54 nbv Assigned To nbv => mkv
2014-12-30 18:05 mkv Assigned To mkv => aml
2015-01-12 08:35 aml Note Added: 0035937
2015-01-12 08:35 aml Assigned To aml => mkv
2015-02-04 17:11 git Note Added: 0037082
2015-02-04 17:12 mkv Note Added: 0037083
2015-02-04 17:13 mkv Assigned To mkv => aml
2015-02-05 11:59 aml Assigned To aml => mkv
2015-02-05 12:00 aml Note Added: 0037103
2015-02-05 13:42 mkv Assigned To mkv => bugmaster
2015-02-05 13:42 mkv Status feedback => tested
2015-02-05 14:28 git Note Added: 0037118
2015-02-05 14:29 mkv Note Added: 0037119
2015-02-06 15:38 bugmaster Changeset attached => occt master e8746a26
2015-02-06 15:38 bugmaster Status tested => verified
2015-02-06 15:38 bugmaster Resolution open => fixed
2015-03-18 13:34 git Note Added: 0038536
2015-05-14 15:29 aiv Status verified => closed
2015-05-14 15:32 aiv Fixed in Version => 6.9.0