MantisBT - Community
View Issue Details
0025755Community[OCCT] OCCT:Modeling Algorithmspublic2015-01-27 10:492015-04-30 12:08
mat127 
ssv 
normalmajor 
assignedopen 
64bitLinux Fedora Core20
[OCCT] 6.8.0 
[OCCT] Unscheduled 
0025755: BRepAlgoAPI_Fuse incorrect behavior
- fuse of two valid shapes produces incorrect result
- input shapes .brep representations in attachment
- previously posted on "usage issues" forum, reporting as a bug recommended by the FSR:

It looks like a bug.
At OCC6.8.0 it doesn't give the missing face, but gives self-intersection of faces:
Draw[5]> bopcheck r
F/F: x3 x74
I suggest you to register the issue in Mantis BugTracker Bugtracker which is available via the Collaborative portal - http://dev.opencascade.org/index.php?q=home/get_involved. [^]
# Use the following DRAW commands to reproduce the problem:
restore shape1.brep b1
restore shape2.brep b2

bclearobjects; bcleartools;
baddobjects b1
baddtools b2

# set the fuzzy value to 0.00001
bfuzzyvalue 0.00001

bfillds
bbop r 1










BRep_Builder builder;

TopoDS_Shape shape1;
BRepTools::Read(shape1, "shape1.brep", builder);
BRepCheck_Analyzer analyzer1(shape1);
cout << "shape1 is valid: " << analyzer1.IsValid() << endl;

TopoDS_Shape shape2;
BRepTools::Read(shape2, "shape2.brep", builder);
BRepCheck_Analyzer analyzer2(shape2);
cout << "shape2 is valid: " << analyzer2.IsValid() << endl;

TopoDS_Shape fuse = BRepAlgoAPI_Fuse(shape1, shape2);
No tags attached.
related to 0025771assigned ssv fusion of cylinder and torus generates self intersections and invalid imbrications 
zip shapes.zip (3,836) 2015-01-27 10:49
https://tracker.dev.opencascade.org/
Issue History
2015-01-27 10:49mat127New Issue
2015-01-27 10:49mat127Assigned To => msv
2015-01-27 10:49mat127File Added: shapes.zip
2015-02-03 10:06msvAssigned Tomsv => pkv
2015-02-03 10:06msvStatusnew => assigned
2015-04-28 13:05msvTarget Version => 6.9.0
2015-04-28 13:05msvRelationship addedrelated to 0025771
2015-04-28 13:12pkvNote Added: 0040341
2015-04-28 13:15pkvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10246#r10246
2015-04-28 13:16pkvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10247#r10247
2015-04-28 13:17pkvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10248#r10248
2015-04-28 13:18pkvAssigned Topkv => msv
2015-04-28 13:20msvNote Added: 0040343
2015-04-28 13:20msvStatusassigned => resolved
2015-04-28 13:20msvAssigned Tomsv => bugmaster
2015-04-28 13:20msvStatusresolved => reviewed
2015-04-28 13:36abvAssigned Tobugmaster => ssv
2015-04-28 13:36abvStatusreviewed => assigned
2015-04-30 12:08msvTarget Version6.9.0 => Unscheduled

Notes
(0040341)
pkv   
2015-04-28 13:12   
I. The Case

The Tcl script below is used to reproduce the case.

restore shape1.brep b1
restore shape2.brep b2

bclearobjects; bcleartools;
baddobjects b1
baddtools b2

bfillds
bbop r 1

II. Analysis

The case (as it is) can not be treated by the algorithm.

The reason is the following:
Some entities from the one argument are intended to be coincide with some entities from the other argument.
But this coincidence is not precise in terms of given values of tolerances of the entities.
On the other hand,
...the shapes interfere with each other in terms of their tolerances...
[see
http://dev.opencascade.org/doc/overview/html/occt_user_guides__boolean_operations.html#occt_algorithms_3 [^]
for more details ]

The declared values of tolerances (1.e-7 for both arguments) is not enough to provide intended coincidence.

To solve the problem the Fuzzy option of Boolean operation algorithm has been designed and developed (6.9.0).
[see
http://dev.opencascade.org/doc/overview/html/occt_user_guides__boolean_operations.html#occt_algorithms_11_1 [^]
for more details]
 
-------------------------------------------------
The following Tcl script can be used for the case
to obtain correct result r:

restore shape1.brep b1
restore shape2.brep b2

bclearobjects; bcleartools;
baddobjects b1
baddtools b2

# set the fuzzy value to 0.00001
bfuzzyvalue 0.00001

bfillds
bbop r 1

III. Resume

It is known CAD models in most cases, have all sorts of inaccuracies.
The algorithm can not guess about inaccuracies of the models.
That is why the algorithm should be supplied by the information about the
available inaccuracies.
The value Fuzzy should be provided by the User who only can control the data.
(0040343)
msv   
2015-04-28 13:20   
Dear bugmaster, please create a test case using suggested by pkv script and close this bug.