View Issue Details

IDProjectCategoryView StatusLast Update
0025712CommunityOCCT:Shape Healingpublic2015-05-14 15:32
ReporterRoman Lygin Assigned Tobugmaster  
PrioritynormalSeverityintegration request 
Status closedResolutionfixed 
Target Version6.9.0Fixed in Version6.9.0 
Summary0025712: Non-deterministic behavior of ShapeFix_Solid
DescriptionShapeFix_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.

Steps To Reproducefor {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
}
TagsNo tags attached.
Test case numberbugs heal(017) bug25712

Attached Files

  • sh.zip (1,099,616 bytes)

Activities

Roman Lygin

2015-01-16 10:14

developer  

sh.zip (1,099,616 bytes)

git

2015-01-16 10:31

administrator   ~0036127

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

gka

2015-01-16 19:02

developer   ~0036166

Branch CR25712 is ready to be tested

git

2015-01-23 18:36

administrator   ~0036473

Branch CR25712 has been updated forcibly by apv.

SHA-1: c1bc06daacb0968cd4b7b9a0bbb1a612db4ebf0c

apv

2015-01-23 18:36

tester   ~0036475

Branch CR25712 has been rebased on the current master

git

2015-01-28 13:58

administrator   ~0036754

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

apv

2015-01-28 15:09

tester   ~0036760

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

git

2015-03-18 13:36

administrator   ~0038559

Branch CR25712 has been deleted by inv.

SHA-1: 5fd2873b4d5871832cfcc941a89f38e1539d8b51

Related Changesets

occt: master a70f5823

2015-01-29 10:56:53

Roman Lygin


Committer: bugmaster Details Diff
0025712: Non-deterministic behavior of ShapeFix_Solid

Test-case for issue 0025712
Affected Issues
0025712
mod - src/BRepTools/BRepTools_ReShape.cdl Diff File
mod - src/ShapeBuild/ShapeBuild_ReShape.cdl Diff File
mod - src/ShapeFix/ShapeFix_Solid.cxx Diff File
add - tests/bugs/heal/bug25712 Diff File

Issue History

Date Modified Username Field Change
2015-01-16 10:14 Roman Lygin New Issue
2015-01-16 10:14 Roman Lygin Assigned To => gka
2015-01-16 10:14 Roman Lygin File Added: sh.zip
2015-01-16 10:31 git Note Added: 0036127
2015-01-16 10:41 Roman Lygin Status new => resolved
2015-01-16 19:02 gka Note Added: 0036166
2015-01-16 19:02 gka Assigned To gka => bugmaster
2015-01-16 19:02 gka Status resolved => reviewed
2015-01-23 16:28 apv Assigned To bugmaster => apv
2015-01-23 18:36 git Note Added: 0036473
2015-01-23 18:36 apv Note Added: 0036475
2015-01-28 13:58 git Note Added: 0036754
2015-01-28 14:00 apv Test case number => bugs heal(017) bug25712
2015-01-28 15:09 apv Note Added: 0036760
2015-01-28 15:09 apv Assigned To apv => bugmaster
2015-01-28 15:09 apv Status reviewed => tested
2015-01-30 14:00 bugmaster Changeset attached => occt master a70f5823
2015-01-30 14:00 bugmaster Status tested => verified
2015-01-30 14:00 bugmaster Resolution open => fixed
2015-03-18 13:36 git Note Added: 0038559
2015-05-14 15:29 aiv Status verified => closed
2015-05-14 15:32 aiv Fixed in Version => 6.9.0