MantisBT - Community
View Issue Details
0024359Community[OCCT] OCCT:Modeling Algorithmspublic2013-11-14 22:252014-01-28 14:49
jaydenshui 
bugmaster 
urgentcrash 
closedfixed 
ALL
[OCCT] 6.6.0 
[OCCT] 6.7.0[OCCT] 6.7.0 
bugs modalg_5(010) bug24359
0024359: Crash on BRepAlgoAPI_Fuse
When fusing 27 spheres of radius 2 at (x, y, z) where x = 1, 2 or 3, y = 1, 2, or 3, and z = 1, 2, or 3, it crashes.
Try the following code in draw.exe. It crashes. I tried 6.7.0 beta, 6.6.0, 6.5.x. All crash.

psphere s01 2; ttranslate s01 1 1 1
psphere s02 2; ttranslate s02 1 1 2
psphere s03 2; ttranslate s03 1 1 3
psphere s04 2; ttranslate s04 1 2 1
psphere s05 2; ttranslate s05 1 2 2
psphere s06 2; ttranslate s06 1 2 3
psphere s07 2; ttranslate s07 1 3 1
psphere s08 2; ttranslate s08 1 3 2
psphere s09 2; ttranslate s09 1 3 3
psphere s10 2; ttranslate s10 2 1 1
psphere s11 2; ttranslate s11 2 1 2
psphere s12 2; ttranslate s12 2 1 3
psphere s13 2; ttranslate s13 2 2 1
psphere s14 2; ttranslate s14 2 2 2
psphere s15 2; ttranslate s15 2 2 3
psphere s16 2; ttranslate s16 2 3 1
psphere s17 2; ttranslate s17 2 3 2
psphere s18 2; ttranslate s18 2 3 3
psphere s19 2; ttranslate s19 3 1 1
psphere s20 2; ttranslate s20 3 1 2
psphere s21 2; ttranslate s21 3 1 3
psphere s22 2; ttranslate s22 3 2 1
psphere s23 2; ttranslate s23 3 2 2
psphere s24 2; ttranslate s24 3 2 3
psphere s25 2; ttranslate s25 3 3 1
psphere s26 2; ttranslate s26 3 3 2
psphere s27 2; ttranslate s27 3 3 3

bop s01 s02; bopfuse s
bop s s03; bopfuse s
bop s s04; bopfuse s
bop s s05; bopfuse s
bop s s06; bopfuse s
bop s s07; bopfuse s
bop s s08; bopfuse s
bop s s09; bopfuse s
bop s s10; bopfuse s
bop s s11; bopfuse s
bop s s12; bopfuse s
bop s s13; bopfuse s
bop s s14; bopfuse s
bop s s15; bopfuse s
bop s s16; bopfuse s
bop s s17; bopfuse s
bop s s18; bopfuse s
bop s s19; bopfuse s
bop s s20; bopfuse s
bop s s21; bopfuse s
bop s s22; bopfuse s
bop s s23; bopfuse s
bop s s24; bopfuse s
bop s s25; bopfuse s
bop s s26; bopfuse s
bop s s27; bopfuse s
C++ code to do it. Crashes also.

TopoDS_Shape r = BRepPrimAPI_MakeSphere(gp_Pnt(10,0,0), 2);
for (int i = 1; i < 4; i++)
  for (int j = 1; j < 4; j++)
    for (int k = 1; k < 4; k++)
      r = BRepAlgoAPI_Fuse(r, BRepPrimAPI_MakeSphere(gp_Pnt(i,j,k), 2));
No tags attached.
Issue History
2013-11-14 22:25jaydenshuiNew Issue
2013-11-14 22:25jaydenshuiAssigned To => ifv
2013-11-15 10:07ifvAssigned Toifv => emv
2013-11-15 10:07ifvStatusnew => assigned
2013-11-17 07:46abvNote Added: 0026675
2013-11-17 07:46abvNote Edited: 0026675bug_revision_view_page.php?bugnote_id=26675#r6248
2013-11-17 18:11jaydenshuiNote Added: 0026676
2013-11-17 18:11jaydenshuiNote Edited: 0026676bug_revision_view_page.php?bugnote_id=26676#r6250
2013-11-17 18:14jaydenshuiNote Edited: 0026676bug_revision_view_page.php?bugnote_id=26676#r6251
2013-11-21 15:44emvNote Added: 0026826
2013-11-21 15:44emvAssigned Toemv => ifv
2013-12-02 11:09ifvNote Added: 0027025
2013-12-02 11:09ifvAssigned Toifv => jgv
2013-12-02 11:09ifvStatusassigned => resolved
2013-12-03 15:52jgvNote Added: 0027053
2013-12-03 15:52jgvStatusresolved => reviewed
2013-12-04 07:36mkvAssigned Tojgv => mkv
2013-12-04 11:27mkvNote Added: 0027073
2013-12-04 11:28mkvTest case number => bugs modalg_5(010) bug24359
2013-12-04 11:28mkvAssigned Tomkv => bugmaster
2013-12-04 11:28mkvStatusreviewed => tested
2013-12-06 17:57bugmasterChangeset attached => occt master ef2d8af7
2013-12-06 17:57bugmasterStatustested => verified
2013-12-06 17:57bugmasterResolutionopen => fixed
2013-12-09 12:02bugmasterTarget Version => 6.7.0
2013-12-19 13:50bugmasterStatusverified => closed
2013-12-19 13:59bugmasterFixed in Version => 6.7.0
2014-01-28 14:49abvNote Added: 0027659

Notes
(0026675)
abv   
2013-11-17 07:46   
Just for information: I have tried this code on OCCT 6.7.0.beta built with VC9 32-bit on Windows; DRAW script produced valid result after some time (~ 25 min, notably all operations until s19 are done quite fast, as well as the last one, s27, so there is performance issue with at least s19). No crash detected.

(0026676)
jaydenshui   
2013-11-17 18:11   
(edited on: 2013-11-17 18:14)
It takes so long time that I think it crashes. I retried it and got a valid result after an overnight running. I also tried the old BRepAlgo_Fuse. It has no such performance issue.

(0026826)
emv   
2013-11-21 15:44   
The problem in the algorithm of projection of 3d curve on the surface. It takes nearly five minutes to project part of the circle on the sphere. Try the sub case in draw:

psphere p1 2; ttranslate p1 1 1 3
psphere p2 2; ttranslate p2 3 1 1
explode p1 f; copy p1_1 f1
explode p2 f; copy p2_1 f2
mksurface s1 f1
mksurface s2 f2
intersect i s1 s2
trim c i_2 5.1724665738417412 6.2831853071795862
don c s1; fit
chrono t reset; chrono t start;
project c2d c s1
#Projection Failed
chrono t stop; chrono t show
#Elapsed time: 0 Hours 4 Minutes 56.3626932083 Seconds
#CPU user time: 295.2942929 seconds
#CPU system time: 0.0312002 seconds
(0027025)
ifv   
2013-12-02 11:09   
Please review CR24359
(0027053)
jgv   
2013-12-03 15:52   
No remarks.
(0027073)
mkv   
2013-12-04 11:27   
Dear BugMaster,

Branch CR24359 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 5038784cc28cb17ddeaf370913da02b779a21219

Number of compiler warnings:

occt component :
Linux: 103 (103 on master)
Windows: 0 (0 on master)

products component :
Linux: 188 (188 on master)
Windows: 237 (237 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR24359-master-occt/Debian60-64/bugs/modalg_5/bug24359.html [^]
http://occt-tests/CR24359-master-occt/Windows-32-VC9/bugs/modalg_5/bug24359.html [^]
bugs modalg_5(010) bug24359: OK

Testing on Linux:
Total MEMORY difference: 358518844 / 358740848
Total CPU difference: 40388.93000000013 / 45679.10000000019

Testing on Windows:
Total MEMORY difference: 413107660 / 412495636
Total CPU difference: 31279.09375 / 33996.28125

There are not differences in images found by testdiff.
(0027659)
abv   
2014-01-28 14:49   
The test modalg_5 bug24359 fails on 64-bit windows on current master