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)
committerapn <apn@opencascade.com>
Tue, 6 Feb 2018 15:58:05 +0000 (18:58 +0300)
Added taking into account distance between edges in the UV space for periodical surfaces in the LocOpe_SplitShape.cxx method ChoixUV

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 04e1c52..80b896b 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 f1949eb..1dbf874 100755 (executable)
@@ -18,4 +18,5 @@
 018 mesh
 019 heal
 020 stlvrml
-021 splitshape
\ No newline at end of file
+021 splitshape
+022 splitshape_1
diff --git a/tests/bugs/splitshape_1/bug29473 b/tests/bugs/splitshape_1/bug29473
new file mode 100644 (file)
index 0000000..856d978
--- /dev/null
@@ -0,0 +1,19 @@
+puts "=============="
+puts " splitshape_1 "
+puts "              "
+puts "=============="
+puts ""
+#puts "   0029473   "
+###################################################
+# Operation "splitshape" in the Test Harness give invalid result on the attached case.
+###################################################
+restore [locate_data_file bug29473_Split.brep] a
+explode a
+explode a_1
+explode a_2
+wire w1 a_2_1 a_2_2 a_2_3
+wire w2 a_2_4 a_2_5
+explode a_1_5 e
+splitshape r1 a_1 a_1_1 w1 a_1_3 w2 a_1_4 a_2_6 a_1_5 a_2_7 @ a_1_5_4 a_2_8
+explode r1 f
+copy r1_1 result
diff --git a/tests/bugs/splitshape_1/end b/tests/bugs/splitshape_1/end
new file mode 100644 (file)
index 0000000..3884b81
--- /dev/null
@@ -0,0 +1,11 @@
+# test script to check validity of shape
+
+########################################################################
+
+checkshape result
+maxtolerance result
+
+smallview
+donly result
+fit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png