1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

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.
This commit is contained in:
emv
2016-04-27 16:28:52 +03:00
parent 08bbed78a8
commit fedf4bc000
13 changed files with 99 additions and 14 deletions

View File

@@ -866,14 +866,20 @@ Standard_Boolean IntTools_Context::IsVertexOnLine
aFirst=aC3D->FirstParameter(); aFirst=aC3D->FirstParameter();
aLast =aC3D->LastParameter(); 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)) { if (!Precision::IsInfinite(aFirst)) {
gp_Pnt aPCFirst=aC3D->Value(aFirst); gp_Pnt aPCFirst=aC3D->Value(aFirst);
aDist=aPv.Distance(aPCFirst); aFirstDist = aPv.Distance(aPCFirst);
if (aDist < aTolSum) { if (aFirstDist < aTolSum) {
bFirstValid = Standard_True;
aT=aFirst; aT=aFirst;
// //
if(aDist > aTolV) { if (aFirstDist > aTolV) {
Extrema_LocateExtPC anExt(aPv, aGAC, aFirst, 1.e-10); Extrema_LocateExtPC anExt(aPv, aGAC, aFirst, 1.e-10);
if(anExt.IsDone()) { 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)) { if (!Precision::IsInfinite(aLast)) {
gp_Pnt aPCLast=aC3D->Value(aLast); gp_Pnt aPCLast=aC3D->Value(aLast);
aDist=aPv.Distance(aPCLast); aDist=aPv.Distance(aPCLast);
if (bFirstValid && (aFirstDist < aDist)) {
return Standard_True;
}
//
if (aDist < aTolSum) { if (aDist < aTolSum) {
aT=aLast; aT=aLast;
// //
@@ -915,6 +926,9 @@ Standard_Boolean IntTools_Context::IsVertexOnLine
return Standard_True; return Standard_True;
} }
} }
else if (bFirstValid) {
return Standard_True;
}
// //
GeomAPI_ProjectPointOnCurve& aProjector=ProjPT(aC3D); GeomAPI_ProjectPointOnCurve& aProjector=ProjPT(aC3D);
aProjector.Perform(aPv); aProjector.Perform(aPv);

View File

@@ -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] source [locate_data_file 200A0-1_BE.asm.1.gdml.tcl]

View File

@@ -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] source [locate_data_file 200a0-1_be_piquage.prt.1.gdml.tcl]

View File

@@ -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] source [locate_data_file 200a0-1_sid_piquage.prt.1.gdml.tcl]

View File

@@ -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] source [locate_data_file 200a0-1_sopac-dn200.asm.1.gdml.tcl]

View File

@@ -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] source [locate_data_file 200a0-1_sopac-dn200_piquage.prt.1.gdml.tcl]

View File

@@ -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] source [locate_data_file 200a0-1_spec.asm.1.gdml.tcl]

View File

@@ -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] source [locate_data_file 200a0-1_spec_piquage.prt.1.gdml.tcl]

View File

@@ -9,11 +9,12 @@
009 modalg_4 009 modalg_4
010 modalg_5 010 modalg_5
011 modalg_6 011 modalg_6
012 moddata_1 012 modalg_7
013 moddata_2 013 moddata_1
014 moddata_3 014 moddata_2
015 step 015 moddata_3
016 caf 016 step
017 mesh 017 caf
018 heal 018 mesh
019 stlvrml 019 heal
020 stlvrml

View File

@@ -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"
}

View File

@@ -0,0 +1 @@
set subgroup modalg

View File

@@ -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

View File

@@ -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