0028473: Incorrect result of 3D offset operation in mode Complete, Join type Intersec...
authoremv <emv@opencascade.com>
Mon, 20 Feb 2017 07:54:22 +0000 (10:54 +0300)
committerapv <apv@opencascade.com>
Fri, 3 Mar 2017 14:01:20 +0000 (17:01 +0300)
Looking for inverted edges among the neutral ones while checking the offset edges on validity (BRepOffset_MakeOffset_1::FindInvalidEdges).

Test cases for the issue.

src/BRepOffset/BRepOffset_MakeOffset_1.cxx
tests/offset/begin
tests/offset/shape_type_i_c/XC1
tests/offset/shape_type_i_c/XC2
tests/offset/shape_type_i_c/YK5 [new file with mode: 0644]
tests/offset/shape_type_i_c/YK6 [new file with mode: 0644]
tests/offset/shape_type_i_c/YK7 [new file with mode: 0644]
tests/offset/shape_type_i_c/YK8 [new file with mode: 0644]
tests/offset/shape_type_i_c/YK9 [new file with mode: 0644]
tests/offset/shape_type_i_c/YL1 [new file with mode: 0644]
tests/offset/shape_type_i_c/YL2 [new file with mode: 0644]

index 826244e..77f3473 100644 (file)
@@ -196,7 +196,6 @@ static
                                  const TopTools_DataMapOfShapeListOfShape& theOEImages,
                                  const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
                                  const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
-                                 const TopTools_IndexedDataMapOfShapeListOfShape& theDMEF,
                                  const TopTools_IndexedDataMapOfShapeListOfShape& theDMVE,
                                  const TopTools_IndexedMapOfShape& theMEdges,
                                  TopTools_MapOfShape& theMEInverted);
@@ -1675,7 +1674,7 @@ void FindInvalidEdges(const TopoDS_Face& theF,
       // check if the edge has been inverted
       Standard_Boolean bInverted = !aNbE ? Standard_False :
         CheckInverted(aEIm, aFOr, theOEImages, theOEOrigins,
-          theEdgesOrigins, aDMEF, aDMVE, aMEdges, theMEInverted);
+          theEdgesOrigins, aDMVE, aMEdges, theMEInverted);
       //
       if (!bInverted || !aNbVOr) {
         theValidEdges.Add(aEIm);
@@ -2162,16 +2161,11 @@ Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm,
                                const TopTools_DataMapOfShapeListOfShape& theOEImages,
                                const TopTools_DataMapOfShapeListOfShape& theOEOrigins,
                                const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
-                               const TopTools_IndexedDataMapOfShapeListOfShape& theDMEF,
                                const TopTools_IndexedDataMapOfShapeListOfShape& theDMVE,
                                const TopTools_IndexedMapOfShape& theMEdges,
                                TopTools_MapOfShape& theMEInverted)
 {
-  if (theDMEF.FindFromKey(theEIm).Extent() > 1) {
-    return Standard_False;
-  }
-  //
-  // it is necessary to compare the direction from first vertex
+  // It is necessary to compare the direction from first vertex
   // to the last vertex on the original edge with the
   // same direction on the new edge. If the directions
   // will be different - the edge has been inverted.
index 4308b17..adc2b73 100644 (file)
@@ -15,7 +15,7 @@ if { [info exists test_image ] == 0 } {
 proc OFFSETSHAPE {distance faces  calcul type} {
     global GlobFaces
     set GlobFaces $faces
-    uplevel #0 explode s f
+    if {[llength $faces] > 0} {uplevel #0 explode s f}
     uplevel #0 offsetparameter 1e-7 $calcul $type
     uplevel #0 offsetload s $distance $faces
     uplevel #0 offsetperform result
index 5f11858..60a62df 100644 (file)
@@ -1,6 +1,5 @@
-puts "TODO OCC27414 ALL: Error: The command cannot be built"
-puts "TODO OCC27414 ALL: gives an empty result"
-puts "TODO OCC27414 ALL: TEST INCOMPLETE"
+puts "TODO OCC27414 ALL: Error : The volume of result shape is"
+puts "TODO OCC27414 ALL: Error : The area of result shape is"
 
 restore [locate_data_file bug26917_input.dom7742_trim1.brep] s
 
index 4deae08..08e7364 100755 (executable)
@@ -1,6 +1,5 @@
 puts "TODO OCC27414 ALL: Error : The volume of result shape is"
 puts "TODO OCC27414 ALL: Error : The area of result shape is"
-puts "TODO OCC27414 ALL: is not equal to zero"
 
 restore [locate_data_file bug26917_input.dom7742_trim2.brep] s
 
diff --git a/tests/offset/shape_type_i_c/YK5 b/tests/offset/shape_type_i_c/YK5
new file mode 100644 (file)
index 0000000..c3b38fc
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug28473_input.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 1.57511e+008 -s 2.91387e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 19 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/YK6 b/tests/offset/shape_type_i_c/YK6
new file mode 100644 (file)
index 0000000..a09d172
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug28473_input.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 1.72351e+008 -s 3.02233e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 19 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/YK7 b/tests/offset/shape_type_i_c/YK7
new file mode 100644 (file)
index 0000000..9715c00
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug28473_input.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 1.87736e+008 -s 3.13198e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 19 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/YK8 b/tests/offset/shape_type_i_c/YK8
new file mode 100644 (file)
index 0000000..3bf17b4
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug28473_input_trim.brep] s
+
+OFFSETSHAPE 10 {} $calcul $type
+
+checkprops result -v 126000 -s 16200
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 6 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/YK9 b/tests/offset/shape_type_i_c/YK9
new file mode 100644 (file)
index 0000000..78b3991
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug28473_input_trim.brep] s
+
+OFFSETSHAPE 15 {} $calcul $type
+
+checkprops result -v 224000 -s 23200
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 6 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/YL1 b/tests/offset/shape_type_i_c/YL1
new file mode 100644 (file)
index 0000000..582c5fd
--- /dev/null
@@ -0,0 +1,10 @@
+restore [locate_data_file bug28473_input_trim.brep] s
+
+OFFSETSHAPE 20 {} $calcul $type
+
+checkprops result -v 360000 -s 31400
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 6 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/offset/shape_type_i_c/YL2 b/tests/offset/shape_type_i_c/YL2
new file mode 100644 (file)
index 0000000..20dc8ed
--- /dev/null
@@ -0,0 +1,24 @@
+restore [locate_data_file bug28473_input.brep] s
+
+offsetparameter 1e-7 c i r
+offsetload s 10
+
+foreach f [explode s f] {
+  mksurface surf $f
+  set found [regexp {Axis   :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z]
+  if {$found == 0} {
+    continue
+  }
+  # set offset value for top faces only
+  if {abs($z + 1) < 1.e-7 } {
+    offsetonface $f 15
+  }
+}
+offsetperform result
+
+checkprops result -v 1.62264e+008 -s 2.94663e+006
+
+unifysamedom result_unif result
+checknbshapes result_unif -face 25 -shell 1
+
+checkview -display result_unif -2d -path ${imagedir}/${test_image}.png