From: emv Date: Wed, 27 Apr 2016 13:28:52 +0000 (+0300) Subject: 0027441: The method IntTools_Context::IsVertexOnLine incorrectly computes parameter... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=fedf4bc000988fdbc45c8769a5fb2bd0666de4a0;p=occt-copy.git 0027441: The method IntTools_Context::IsVertexOnLine incorrectly computes parameter of the point on the curve Choosing the closest bound to the checking point. Test cases for the issue. Updating test cases for the current behavior. --- diff --git a/src/IntTools/IntTools_Context.cxx b/src/IntTools/IntTools_Context.cxx index 32cfb7bfe3..d1f1a7eb80 100644 --- a/src/IntTools/IntTools_Context.cxx +++ b/src/IntTools/IntTools_Context.cxx @@ -866,14 +866,20 @@ Standard_Boolean IntTools_Context::IsVertexOnLine aFirst=aC3D->FirstParameter(); aLast =aC3D->LastParameter(); // - //Checking extermities first + Standard_Boolean bIsClosed = IntTools_Tools::IsClosed(aC3D); + // Checking extermities first + // It is necessary to chose the closest bound to the point + Standard_Boolean bFirstValid = Standard_False; + Standard_Real aFirstDist = Precision::Infinite(); + // if (!Precision::IsInfinite(aFirst)) { gp_Pnt aPCFirst=aC3D->Value(aFirst); - aDist=aPv.Distance(aPCFirst); - if (aDist < aTolSum) { + aFirstDist = aPv.Distance(aPCFirst); + if (aFirstDist < aTolSum) { + bFirstValid = Standard_True; aT=aFirst; // - if(aDist > aTolV) { + if (aFirstDist > aTolV) { Extrema_LocateExtPC anExt(aPv, aGAC, aFirst, 1.e-10); if(anExt.IsDone()) { @@ -887,14 +893,19 @@ Standard_Boolean IntTools_Context::IsVertexOnLine } } // - return Standard_True; + if (bIsClosed) { + return Standard_True; + } } } // - //if (!Precision::IsInfinite(aFirst)) { if (!Precision::IsInfinite(aLast)) { gp_Pnt aPCLast=aC3D->Value(aLast); aDist=aPv.Distance(aPCLast); + if (bFirstValid && (aFirstDist < aDist)) { + return Standard_True; + } + // if (aDist < aTolSum) { aT=aLast; // @@ -915,6 +926,9 @@ Standard_Boolean IntTools_Context::IsVertexOnLine return Standard_True; } } + else if (bFirstValid) { + return Standard_True; + } // GeomAPI_ProjectPointOnCurve& aProjector=ProjPT(aC3D); aProjector.Perform(aPv); diff --git a/tests/boolean/gdml_private/W6 b/tests/boolean/gdml_private/W6 index 1147039c3e..39b185e8e1 100644 --- a/tests/boolean/gdml_private/W6 +++ b/tests/boolean/gdml_private/W6 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200A0-1_BE.asm.1.gdml.tcl] diff --git a/tests/boolean/gdml_private/W8 b/tests/boolean/gdml_private/W8 index 478cc03c12..0eb736e2c3 100644 --- a/tests/boolean/gdml_private/W8 +++ b/tests/boolean/gdml_private/W8 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200a0-1_be_piquage.prt.1.gdml.tcl] diff --git a/tests/boolean/gdml_private/ZC6 b/tests/boolean/gdml_private/ZC6 index f7356da675..d83faeed86 100644 --- a/tests/boolean/gdml_private/ZC6 +++ b/tests/boolean/gdml_private/ZC6 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200a0-1_sid_piquage.prt.1.gdml.tcl] diff --git a/tests/boolean/gdml_private/ZC8 b/tests/boolean/gdml_private/ZC8 index dc678c12cc..4661e67360 100644 --- a/tests/boolean/gdml_private/ZC8 +++ b/tests/boolean/gdml_private/ZC8 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200a0-1_sopac-dn200.asm.1.gdml.tcl] diff --git a/tests/boolean/gdml_private/ZD1 b/tests/boolean/gdml_private/ZD1 index bffc5c6a4f..011a9b9531 100644 --- a/tests/boolean/gdml_private/ZD1 +++ b/tests/boolean/gdml_private/ZD1 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200a0-1_sopac-dn200_piquage.prt.1.gdml.tcl] diff --git a/tests/boolean/gdml_private/ZD9 b/tests/boolean/gdml_private/ZD9 index cff3161f5d..8b7d69d522 100644 --- a/tests/boolean/gdml_private/ZD9 +++ b/tests/boolean/gdml_private/ZD9 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200a0-1_spec.asm.1.gdml.tcl] diff --git a/tests/boolean/gdml_private/ZE2 b/tests/boolean/gdml_private/ZE2 index 0bba5386ae..48b09a85ec 100644 --- a/tests/boolean/gdml_private/ZE2 +++ b/tests/boolean/gdml_private/ZE2 @@ -1,2 +1,4 @@ +puts "TODO ?OCC26619 ALL: Faulty shapes in variables faulty_1 to faulty_" + source [locate_data_file 200a0-1_spec_piquage.prt.1.gdml.tcl] diff --git a/tests/bugs/grids.list b/tests/bugs/grids.list index d90570731e..534a46e17f 100755 --- a/tests/bugs/grids.list +++ b/tests/bugs/grids.list @@ -9,11 +9,12 @@ 009 modalg_4 010 modalg_5 011 modalg_6 -012 moddata_1 -013 moddata_2 -014 moddata_3 -015 step -016 caf -017 mesh -018 heal -019 stlvrml +012 modalg_7 +013 moddata_1 +014 moddata_2 +015 moddata_3 +016 step +017 caf +018 mesh +019 heal +020 stlvrml diff --git a/tests/bugs/modalg_6/bug27441 b/tests/bugs/modalg_6/bug27441 new file mode 100644 index 0000000000..1489df5d68 --- /dev/null +++ b/tests/bugs/modalg_6/bug27441 @@ -0,0 +1,16 @@ +puts "============" +puts "OCC27441" +puts "============" +puts "" +############################### +## The method IntTools_ContextIsVertexOnLine incorrectly computes parameter of the point on the curve +############################### + +restore [locate_data_file bug27428_shapes.brep] b +explode b +bsection result b_1 b_2 +set bcheck [bopcheck result] +puts $bcheck +if {![regexp {This shape seems to be OK.} $bcheck]} { + puts "Error: bopcheck failed" +} diff --git a/tests/bugs/modalg_7/begin b/tests/bugs/modalg_7/begin new file mode 100644 index 0000000000..5a5d7f9ae9 --- /dev/null +++ b/tests/bugs/modalg_7/begin @@ -0,0 +1 @@ +set subgroup modalg diff --git a/tests/bugs/modalg_7/bug28883_1 b/tests/bugs/modalg_7/bug28883_1 new file mode 100644 index 0000000000..38d3a43544 --- /dev/null +++ b/tests/bugs/modalg_7/bug28883_1 @@ -0,0 +1,21 @@ +puts "=======" +puts "OCC28883" +puts "=======" +puts "" +################################################## +# Invalid result of Section operation +################################################## + +restore [locate_data_file bug28883_Prism.brep] b1 +restore [locate_data_file bug28883_LES_2d_shell.brep] b2 + +explode b1 f; copy b1_51 b1 +explode b2 f; copy b2_8 b2 + +bsection result b1 b2 + +checkshape result +checksection result + +checknbshapes result -edge 1 -vertex 2 +set length 7.13116e-007 diff --git a/tests/bugs/modalg_7/bug28883_2 b/tests/bugs/modalg_7/bug28883_2 new file mode 100644 index 0000000000..913c4f9782 --- /dev/null +++ b/tests/bugs/modalg_7/bug28883_2 @@ -0,0 +1,18 @@ +puts "=======" +puts "OCC28883" +puts "=======" +puts "" +################################################## +# Invalid result of Section operation +################################################## + +restore [locate_data_file bug28883_Prism.brep] b1 +restore [locate_data_file bug28883_LES_2d_shell.brep] b2 + +bsection result b1 b2 + +checkshape result +checksection result + +checknbshapes result -edge 133 -vertex 134 +set length 2.20769