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();
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);

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]

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]

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]

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]

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]

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]

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]

View File

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

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