View Issue Details

IDProjectCategoryView StatusLast Update
0023972CommunityOCCT:Modeling Algorithmspublic2014-05-05 13:39
ReporterRoman Lygin Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2010 
Product Version6.6.0 
Target Version6.7.1Fixed in Version6.7.1 
Summary0023972: Exception thrown when intersecting two cones
DescriptionA corner case - due to rounding errors the intersection algorithm fails to find an obvious solution.
The root-cause is deep in the math package when searching for a function root. The math_FunctionAllRoots finds that the function changes the sign at the boundaries of the range, but math_FunctionRoots later fails to confirm that. The reason is because the latter uses A + dX * n, and the last end it does not reach B. The fix pins the last point to the range boundary.

The fix also correctly computes deltaU which was previously computed wrong.
Steps To ReproduceSee the test case enclosed.
Note that saving the input surfaces hides the issue due to rounding error. Therefore explicit construction is used.
TagsNo tags attached.
Test case numberbugs fclasses(002) bug23972

Attached Files

  • OCCTestLib_Intersection_excerpt.zip (878 bytes)

Activities

Roman Lygin

2013-05-19 21:54

developer  

OCCTestLib_Intersection_excerpt.zip (878 bytes)

Roman Lygin

2013-05-19 22:01

developer   ~0024432

The fix pushed into the git repository.
math_FunctionRoots.cxx is based on top of 0023952 and includes this file from that fix.

jgv

2013-05-28 10:47

developer   ~0024530

No remarks.

mkv

2013-05-30 15:20

tester   ~0024570

Dear BugMaster,

Branch CR23972 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 8f9daf77966b0088a452e6b0747bcdcd37bc3489

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)

Regressions:
http://occt-tests/CR23972-master-occt/Debian60-64/summary.html
http://occt-tests/CR23972-master-occt/Windows-32-VC9/summary.html
bugs modalg_1(006) buc60409_1, buc60409_2, buc60409_3, buc60782_3
offset wire_closed_inside_0_005(010) B5, B7, C5, C6, C7, D1, D2, E9, F5, F6
offset wire_closed_inside_0_025(011) C5, C6, C7, D1, D2, E9, F5, F6
offset wire_closed_inside_0_075(012) C5, C6, C7, E9
offset wire_closed_outside_0_005(007) C5, C6, C7, D1, D2, E9, F5, F6
offset wire_closed_outside_0_025(008) C5, C7, D2, E9, F5, F6
offset wire_closed_outside_0_075(009) C5, C7, D2, F5, F6
offset wire_unclosed_outside_0_005(013) A7, A8, A9, B7, C3
offset wire_unclosed_outside_0_025(014) A7, A8, B7, C3
offset wire_unclosed_outside_0_075(015) A7, A8, A9, B7, C3

Improvements:
No improvements

Testing cases:
bugs fclasses(002) bug23972 - OK.

Testing on Linux:
Total MEMORY difference: 362403256 / 362078500
Total CPU difference: 50391.50000000078 / 43460.110000001194

Testing on Windows:
Total MEMORY difference: 414216832 / 413471612
Total CPU difference: 33147.84375 / 34355.046875

There are not differences in images found by testdiff.

Roman Lygin

2013-10-27 17:43

developer   ~0026294

As all the regressions reported above are not available in the public test suite, I could not analyze them until recently received a customer case exhibiting a likely similar symptom.

In math_FunctionRoots ctor, the initial version of the fix pinned the parameter X for the last iteration i to the boundary value XN. In some particular cases this led to the situation when a function stopped changing its sign at that last parameter X, and the algorithm could not find a respective function root. Of course, such sensitivity was only hidden by the previous behavior and was not reliably addressed anyway.

The fix has been modified to keep the previous behavior for the parameter at the last iteration (i.e. X_last = X0 + N*dx) but if X_last < XN then one more iteration is added, N is incremented, and the new parameter X_last gets pinned to XN.

In addition, if function computation has failed at any iteration, the algorithm
quits right away, not performing remaining iterations.


The fix has been pushed into CR23972_2. Please review.

ifv

2013-10-28 17:07

developer   ~0026307

Ok

mkv

2013-10-29 15:47

tester   ~0026335

Dear BugMaster,

Branch CR23972_2 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 2f6693916a7b949f60e1fdc69a45383696614570

Number of compiler warnings:

occt component :
Linux: 319 (323 on master)
Windows: 0 (0 on master)

products component :
Linux: 189 (189 on master)
Windows: 287 (287 on master)

Regressions/Differences:
http://occt-tests/CR23972-2-master-occt/Windows-32-VC9/summary.html
http://occt-tests/CR23972-2-master-occt/Debian60-64/summary.html
de step_2(005) A3, C9, G9
de step_3(006) B4, B5, D1, F3
heal split_continuity_advanced(015) W8
offset wire_closed_inside_0_005(010) B7, C5, C6, C7, D2, E9, F5, F6
offset wire_closed_inside_0_025(011) C5, C6, C7, D1, D2, E9, F5, F6
offset wire_closed_inside_0_075(012) C5, C6, C7, E9
offset wire_closed_outside_0_005(007) C5, C6, C7, D1, D2, E9, F5, F6
offset wire_closed_outside_0_025(008) C5, C7, D2, E9, F5, F6
offset wire_closed_outside_0_075(009) C5, C7, D2, F5, F6
offset wire_unclosed_outside_0_005(013) A7, A8, A9, B7, C3, C4
offset wire_unclosed_outside_0_025(014) A7, A8, B7, C3, C4
offset wire_unclosed_outside_0_075(015) A7, A8, A9, B7, C3, C4

Testing cases:
http://occt-tests/CR23972-2-master-occt/Windows-32-VC9/bugs/fclasses/bug23972.html
bugs fclasses(002) bug23972: FAILED - it is necessary to add new draw command in QABugs_19.cxx (see CR23972)

Testing on Linux:
Total MEMORY difference: 351674408 / 351955104
Total CPU difference: 41947.330000001115 / 39202.56000000068

Testing on Windows:
Total MEMORY difference: 404505844 / 403145084
Total CPU difference: 28673.4375 / 33627.046875

There are not differences in images found by testdiff.

Roman Lygin

2013-11-16 21:58

developer   ~0026674

As discussed with Andrey offline in emails, please defer this bug. There is no straightforward way to address it. Moreover, using /arch:SSE2 option as of 6.7.0 seems to address it (numerical computations performed using SSE2 give different results than with former x87).

abv

2014-04-04 17:27

manager   ~0028692

Test case should be integrated to OCCT 6.7.1 and current master (commit 2bbf4c9f0ff91c469fc450e072e3e98413776e28)

bugmaster

2014-04-09 13:01

administrator   ~0028761

Andrey,

Please recheck testing case from CR23972_2

Related Changesets

occt: master e6c9f595

2013-10-29 13:22:11

mkv


Committer: apn Details Diff
0023972: Exception thrown when intersecting two cones

DRAW command and test case for issue CR23972
Affected Issues
0023972
mod - src/QABugs/QABugs_19.cxx Diff File
add - tests/bugs/fclasses/bug23972 Diff File

Issue History

Date Modified Username Field Change
2013-05-19 21:52 Roman Lygin New Issue
2013-05-19 21:52 Roman Lygin Assigned To => ifv
2013-05-19 21:52 Roman Lygin File Added: OCCTestLib_Intersection_excerpt.zip
2013-05-19 21:54 Roman Lygin File Deleted: OCCTestLib_Intersection_excerpt.zip
2013-05-19 21:54 Roman Lygin File Added: OCCTestLib_Intersection_excerpt.zip
2013-05-19 22:01 Roman Lygin Note Added: 0024432
2013-05-19 22:01 Roman Lygin Status new => resolved
2013-05-28 09:51 ifv Assigned To ifv => jgv
2013-05-28 10:47 jgv Note Added: 0024530
2013-05-28 10:47 jgv Status resolved => reviewed
2013-05-28 11:49 mkv Assigned To jgv => mkv
2013-05-30 15:20 mkv Note Added: 0024570
2013-05-30 15:22 mkv Test case number => bugs fclasses(002) bug23972
2013-05-30 15:22 mkv Assigned To mkv => abv
2013-05-30 15:22 mkv Status reviewed => assigned
2013-05-30 15:26 abv Assigned To abv => ifv
2013-10-27 17:43 Roman Lygin Note Added: 0026294
2013-10-27 17:43 Roman Lygin Status assigned => resolved
2013-10-28 17:07 ifv Note Added: 0026307
2013-10-28 17:07 ifv Status resolved => reviewed
2013-10-29 06:50 mkv Assigned To ifv => mkv
2013-10-29 15:47 mkv Note Added: 0026335
2013-10-29 15:48 mkv Assigned To mkv => abv
2013-10-29 15:48 mkv Status reviewed => assigned
2013-11-16 21:58 Roman Lygin Note Added: 0026674
2013-12-26 11:28 abv Status assigned => feedback
2014-04-04 17:27 abv Note Added: 0028692
2014-04-04 17:27 abv Target Version => 6.7.1
2014-04-04 17:27 abv Assigned To abv => bugmaster
2014-04-09 13:01 bugmaster Assigned To bugmaster => Roman Lygin
2014-04-09 13:01 bugmaster Note Added: 0028761
2014-04-11 14:43 apn Changeset attached => occt master e6c9f595
2014-04-11 14:43 apn Assigned To Roman Lygin => apn
2014-04-11 14:43 apn Status feedback => verified
2014-04-11 14:43 apn Resolution open => fixed
2014-05-05 13:20 bugmaster Status verified => closed
2014-05-05 13:39 aiv Fixed in Version => 6.7.1