]> OCCT Git - occt.git/commitdiff
0024909: Modeling Algorithms - SIGSEGV in buildsweep
authorakondrat <alexey.kondratyev@opencascade.com>
Tue, 9 Aug 2022 11:38:45 +0000 (14:38 +0300)
committerakondrat <alexey.kondratyev@opencascade.com>
Tue, 9 Aug 2022 11:39:38 +0000 (14:39 +0300)
Update algorithm to preventing regression.

src/BRepFill/BRepFill_CompatibleWires.cxx
tests/bugs/modalg_7/bug24909_2

index 67ae17f2185b304c8afc4538fdeef168d78fe251..bf1c6b2969073bea416086ca499292b3879cfc3b 100644 (file)
@@ -1155,7 +1155,24 @@ void BRepFill_CompatibleWires::
        
        // parse candidate edges
        Standard_Real scal1,scal2;
-       if ( (V1.IsSame(VVF)&&V2.IsSame(VVL)) || (V2.IsSame(VVF)&&V1.IsSame(VVL)) ) {
+
+  Standard_Boolean isEqual = (V1.IsSame(VVF) && V2.IsSame(VVL)) || (V2.IsSame(VVF) && V1.IsSame(VVL));
+
+  if (!isEqual)
+  {
+    itF = (MapVLV.FindFromKey(VF));
+    itL = (MapVLV.FindFromKey(VL));
+    rang = ideb - 1;
+    while (rang < i) {
+      itF.Next();
+      itL.Next();
+      rang++;
+    }
+    V1 = TopoDS::Vertex(itF.Value()), V2 = TopoDS::Vertex(itL.Value());
+    isEqual = (V1.IsSame(VVF) && V2.IsSame(VVL)) || (V2.IsSame(VVF) && V1.IsSame(VVL));
+  }
+
+  if (isEqual) {
          Standard_Real U1param = BRep_Tool::Parameter(VVF,E);
          Standard_Real U2param = BRep_Tool::Parameter(VVL,E);
          BRepAdaptor_Curve CurveE(E);
index 26bfc46219362b29a0624fd57e0271ad6b978e5d..fa96f85f34ed1ea351c2aa46f32060754dffb3d2 100644 (file)
@@ -3,8 +3,6 @@ puts "0024909: Modeling Algorithms - SIGSEGV in buildsweep"
 puts "========"
 puts ""
 
-puts "REQUIRED All: Standard_ConstructionError: BRepFill :: profiles are inconsistent"
-
 pload MODELING
 restore [locate_data_file bug24909_BezCurve.brep] BezCurve
 ttranslate BezCurve 0 -8 0
@@ -24,6 +22,5 @@ wire Circle001 Circle001-edge
 trotate Circle001 0 0 0 0.577350269189625731 0.577350269189625731 0.577350269189625731 120
 ttranslate Circle001 0 -71 203.5
 addsweep Circle001
-
-catch { buildsweep Sweep001 -C -S } message 
+buildsweep Sweep001 -C -S