]> OCCT Git - occt-copy.git/commitdiff
0029473: DRAW command "splitshape" produces invalid result on the cylindrical face.
authorgka <gka@opencascade.com>
Fri, 2 Feb 2018 09:32:46 +0000 (12:32 +0300)
committeremv <emv@opencascade.com>
Mon, 5 Feb 2018 08:20:30 +0000 (11:20 +0300)
Fix for porting SenerAlgo on the OCCT 720.

Test case for the issue.

src/LocOpe/LocOpe_SplitShape.cxx
tests/bugs/grids.list
tests/bugs/splitshape_1/bug29473 [new file with mode: 0644]
tests/bugs/splitshape_1/end [new file with mode: 0644]

index 04e1c52b5920f926a7eff137246307d62585f50c..80b896b7218d3d5e49459e8797f2763c381b8424 100644 (file)
@@ -887,7 +887,7 @@ Standard_Boolean LocOpe_SplitShape::AddOpenWire(const TopoDS_Wire& W,
     aLocalFace  = FaceRef.Oriented(wfirst.Orientation());
     GetDirection(LastEdge, TopoDS::Face(aLocalFace),plast , dlast, Standard_False);
    
-    Standard_Boolean cond;
+    Standard_Boolean cond = Standard_True;
 
     if(IsPeriodic) {
 
@@ -1511,7 +1511,7 @@ Standard_Boolean ChoixUV(const TopoDS_Edge& Last,
 
   BRepAdaptor_Surface surf(F,Standard_False); // no restriction
   surf.D0 (plst.X(), plst.Y(), aPlst);
-
   gp_Dir2d ref2d(dlst);
 
   Handle(Geom2d_Curve) C2d;
@@ -1524,6 +1524,8 @@ Standard_Boolean ChoixUV(const TopoDS_Edge& Last,
     TopoDS_Edge anEdge = TopoDS::Edge (Poss.FindKey (index));
     
     GetDirection(anEdge, F, p2d, v2d, Standard_True);
+    if(!SameUV(plst,p2d,surf))
+      continue;
 
     surf.D0 (p2d.X(), p2d.Y(), aPCur);
 
index f1949ebb8488cb32c899e31f7f418c8569291e0a..5d666dbcad950d271068c3daafbcb597db82486c 100755 (executable)
@@ -18,4 +18,5 @@
 018 mesh
 019 heal
 020 stlvrml
-021 splitshape
\ No newline at end of file
+021 splitshape
+022 splitshape1
diff --git a/tests/bugs/splitshape_1/bug29473 b/tests/bugs/splitshape_1/bug29473
new file mode 100644 (file)
index 0000000..370d35b
--- /dev/null
@@ -0,0 +1,19 @@
+puts "=============="
+puts "   splitshape "
+puts "   case1      "
+puts "=============="
+puts ""
+#puts "   OCC26354   "
+###################################################
+# Operation "splitshape" in the Test Harness give invalid result on the attached case.
+###################################################
+
+restore [locate_data_file bug29473_SplitShape.brep] a
+restore [locate_data_file bug29473_SplitEdges.brep] b
+explode a
+explode b
+wire w1 b_1 b_2 b_3
+wire w2 b_4 b_5
+splitshape r1 a a_1 w1 a_2 w2 a_3 b_6 a_4 b_7 @ a_5 b_8
+explode r1 f
+copy r_1 result
diff --git a/tests/bugs/splitshape_1/end b/tests/bugs/splitshape_1/end
new file mode 100644 (file)
index 0000000..fffa720
--- /dev/null
@@ -0,0 +1,17 @@
+# Main script in this test grid; does all the job.
+# Individual test scripts are used only to specify data file and reference
+# test data (expected values of test execution).
+# The procedure is:
+# - load specified data files
+# - check validity of result shape, vizualize building compartments, 
+
+########################################################################
+
+checkshape result
+maxtolerance result
+checknbshapes  $result -face $ref_nbf
+
+smallview
+display result
+fit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png