MantisBT - Community
View Issue Details
0025712Community[OCCT] OCCT:Shape Healingpublic2015-01-16 10:142015-05-14 15:32
Roman Lygin 
bugmaster 
normalintegration request 
closedfixed 
 
[OCCT] 6.9.0[OCCT] 6.9.0 
bugs heal(017) bug25712
0025712: Non-deterministic behavior of ShapeFix_Solid
ShapeFix_Solid has non-deterministic behavior in the case of composing multiple shells into a compound.
The root-cause is iteration over TopTools_DataMapOfShapeListOfShape which does not guarantee the order.
The enclosed file contains an input shape and two possible versions of resulting ones.

The fix also contains BRepTools_ReShape and subclass ShapeBuild_ReShape with all methods made virtual (not only Apply()). This mechanism is helpful to trace modifications stored and replayed in ReShape, for instance:
class MyReShape : public ShapeBuild_ReShape
{
    virtual void Replace (const TopoDS_Shapeconst TopoDS_Shape& ashape,
                                 const TopoDS_Shape& anewshape,
                                 const Standard_Boolean oriented) override
    {
         cout << "Storing " << GetInfo (ashape) << " and " << GetInfo (anewshape) << endl;
         ShapeBuild_ReShape::Replace();
    }
};

Handle_ShapeFix_Shape sfs = ...;
sfs->SetContext (new MyReShape);

Making methods virtual has no memory footprint implications as vtbl already existed. Performance impact is less than negligible given that the extra cost of ReShape calls is multiple order of magnitudes less than ShapeFix itself. Yet the new mechanism provides multiple conveniences without any need of recompilation of the OCC code.

for {set i 1} {$i <= $N} { incr i } {
restore comp16.brep c
fix rc c
explode rc #two compounds
explode rc_2
numshape rc_2_1
numshape rc_2_2
# the number of shapes in rc_2_1 and rc_2_2 must not change from run to run
}
No tags attached.
zip sh.zip (1,099,616) 2015-01-16 10:14
https://tracker.dev.opencascade.org/
Issue History
2015-01-16 10:14Roman LyginNew Issue
2015-01-16 10:14Roman LyginAssigned To => gka
2015-01-16 10:14Roman LyginFile Added: sh.zip
2015-01-16 10:31gitNote Added: 0036127
2015-01-16 10:41Roman LyginStatusnew => resolved
2015-01-16 19:02gkaNote Added: 0036166
2015-01-16 19:02gkaAssigned Togka => bugmaster
2015-01-16 19:02gkaStatusresolved => reviewed
2015-01-23 16:28apvAssigned Tobugmaster => apv
2015-01-23 18:36gitNote Added: 0036473
2015-01-23 18:36apvNote Added: 0036475
2015-01-28 13:58gitNote Added: 0036754
2015-01-28 14:00apvTest case number => bugs heal(017) bug25712
2015-01-28 15:09apvNote Added: 0036760
2015-01-28 15:09apvAssigned Toapv => bugmaster
2015-01-28 15:09apvStatusreviewed => tested
2015-01-30 14:00bugmasterChangeset attached => occt master a70f5823
2015-01-30 14:00bugmasterStatustested => verified
2015-01-30 14:00bugmasterResolutionopen => fixed
2015-03-18 13:36gitNote Added: 0038559
2015-05-14 15:29aivStatusverified => closed
2015-05-14 15:32aivFixed in Version => 6.9.0

Notes
(0036127)
git   
2015-01-16 10:31   
Branch CR25712 has been created by Roman Lygin.

SHA-1: 9e962fc6de99ac2c35143ed0a4b3db94884197dc


Detailed log of new commits:

Author: Roman Lygin
Date: Fri Jan 16 10:31:17 2015 +0400

    0025712: Non-deterministic behavior of ShapeFix_Solid
(0036166)
gka   
2015-01-16 19:02   
Branch CR25712 is ready to be tested
(0036473)
git   
2015-01-23 18:36   
Branch CR25712 has been updated forcibly by apv.

SHA-1: c1bc06daacb0968cd4b7b9a0bbb1a612db4ebf0c
(0036475)
apv   
2015-01-23 18:36   
Branch CR25712 has been rebased on the current master
(0036754)
git   
2015-01-28 13:58   
Branch CR25712 has been updated by apv.

SHA-1: 5fd2873b4d5871832cfcc941a89f38e1539d8b51


Detailed log of new commits:

Author: apv
Date: Wed Jan 28 13:58:05 2015 +0300

    Test-case for issue 0025712

(0036760)
apv   
2015-01-28 15:09   
Dear BugMaster,

Branch CR25712 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: c1bc06daacb0968cd4b7b9a0bbb1a612db4ebf0c

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:
Not detected

Testing cases:
bugs heal(017) bug25712 - OK
http://occt-tests/CR25712-master-occt/Debian60-64/bugs/heal/bug25712.html [^]
http://occt-tests/CR25712-master-occt/Windows-32-VC10/bugs/heal/bug25712.html [^]

Testing on Linux:
Total MEMORY difference: 369624564 / 370114884
Total CPU difference: 52727.16000000017 / 51750.710000000094

Testing on Windows:
Total MEMORY difference: 276294800 / 275769192
Total CPU difference: 47352.265625 / 38148.296875
(0038559)
git   
2015-03-18 13:36   
Branch CR25712 has been deleted by inv.

SHA-1: 5fd2873b4d5871832cfcc941a89f38e1539d8b51