diff --git a/src/LocOpe/LocOpe_SplitShape.cxx b/src/LocOpe/LocOpe_SplitShape.cxx index 04e1c52b59..80b896b721 100644 --- a/src/LocOpe/LocOpe_SplitShape.cxx +++ b/src/LocOpe/LocOpe_SplitShape.cxx @@ -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); diff --git a/tests/bugs/grids.list b/tests/bugs/grids.list index f1949ebb84..5d666dbcad 100755 --- a/tests/bugs/grids.list +++ b/tests/bugs/grids.list @@ -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 index 0000000000..370d35bed6 --- /dev/null +++ b/tests/bugs/splitshape_1/bug29473 @@ -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 index 0000000000..fffa720979 --- /dev/null +++ b/tests/bugs/splitshape_1/end @@ -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