MantisBT - Community
View Issue Details
0023972Community[OCCT] OCCT:Modeling Algorithmspublic2013-05-19 21:522014-05-05 13:39
Roman Lygin 
apn 
normalminor 
closedfixed 
WindowsVC++ 201032 bit
[OCCT] 6.6.0 
[OCCT] 6.7.1[OCCT] 6.7.1 
bugs fclasses(002) bug23972
0023972: Exception thrown when intersecting two cones
A 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.
See the test case enclosed.
Note that saving the input surfaces hides the issue due to rounding error. Therefore explicit construction is used.
No tags attached.
zip OCCTestLib_Intersection_excerpt.zip (878) 2013-05-19 21:54
https://tracker.dev.opencascade.org/
Issue History
2013-05-19 21:52Roman LyginNew Issue
2013-05-19 21:52Roman LyginAssigned To => ifv
2013-05-19 21:52Roman LyginFile Added: OCCTestLib_Intersection_excerpt.zip
2013-05-19 21:54Roman LyginFile Deleted: OCCTestLib_Intersection_excerpt.zip
2013-05-19 21:54Roman LyginFile Added: OCCTestLib_Intersection_excerpt.zip
2013-05-19 22:01Roman LyginNote Added: 0024432
2013-05-19 22:01Roman LyginStatusnew => resolved
2013-05-28 09:51ifvAssigned Toifv => jgv
2013-05-28 10:47jgvNote Added: 0024530
2013-05-28 10:47jgvStatusresolved => reviewed
2013-05-28 11:49mkvAssigned Tojgv => mkv
2013-05-30 15:20mkvNote Added: 0024570
2013-05-30 15:22mkvTest case number => bugs fclasses(002) bug23972
2013-05-30 15:22mkvAssigned Tomkv => abv
2013-05-30 15:22mkvStatusreviewed => assigned
2013-05-30 15:26abvAssigned Toabv => ifv
2013-10-27 17:43Roman LyginNote Added: 0026294
2013-10-27 17:43Roman LyginStatusassigned => resolved
2013-10-28 17:07ifvNote Added: 0026307
2013-10-28 17:07ifvStatusresolved => reviewed
2013-10-29 06:50mkvAssigned Toifv => mkv
2013-10-29 15:47mkvNote Added: 0026335
2013-10-29 15:48mkvAssigned Tomkv => abv
2013-10-29 15:48mkvStatusreviewed => assigned
2013-11-16 21:58Roman LyginNote Added: 0026674
2013-12-26 11:28abvStatusassigned => feedback
2014-04-04 17:27abvNote Added: 0028692
2014-04-04 17:27abvTarget Version => 6.7.1
2014-04-04 17:27abvAssigned Toabv => bugmaster
2014-04-09 13:01bugmasterAssigned Tobugmaster => Roman Lygin
2014-04-09 13:01bugmasterNote Added: 0028761
2014-04-11 14:43apnChangeset attached => occt master e6c9f595
2014-04-11 14:43apnAssigned ToRoman Lygin => apn
2014-04-11 14:43apnStatusfeedback => verified
2014-04-11 14:43apnResolutionopen => fixed
2014-05-05 13:20bugmasterStatusverified => closed
2014-05-05 13:39aivFixed in Version => 6.7.1

Notes
(0024432)
Roman Lygin   
2013-05-19 22:01   
The fix pushed into the git repository.
math_FunctionRoots.cxx is based on top of 0023952 and includes this file from that fix.
(0024530)
jgv   
2013-05-28 10:47   
No remarks.
(0024570)
mkv   
2013-05-30 15:20   
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.
(0026294)
Roman Lygin   
2013-10-27 17:43   
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.
(0026307)
ifv   
2013-10-28 17:07   
Ok
(0026335)
mkv   
2013-10-29 15:47   
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.
(0026674)
Roman Lygin   
2013-11-16 21:58   
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).
(0028692)
abv   
2014-04-04 17:27   
Test case should be integrated to OCCT 6.7.1 and current master (commit 2bbf4c9f0ff91c469fc450e072e3e98413776e28)
(0028761)
bugmaster   
2014-04-09 13:01   
Andrey,

Please recheck testing case from CR23972_2