1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0024896: BRepExtrema is giving wrong intersection point between curve and planar face

Added test case bugs/moddata_3/bug24896. Modified unstable test cases and increased cpu limit in bugs/modalg_5/bug24190.
This commit is contained in:
ifv 2014-05-15 17:53:58 +04:00 committed by apn
parent 004e846676
commit 29d778bf16
7 changed files with 318 additions and 205 deletions

View File

@ -228,6 +228,59 @@ void Extrema_GenExtCS::Perform(const Adaptor3d_Curve& C,
Standard_Real aCUAdd = (mytsup - mytmin) / mytsample;
Standard_Real aSUAdd = (myusup - myumin) / myusample;
Standard_Real aSVAdd = (myvsup - myvmin) / myvsample;
Standard_Real tres = C.Resolution(1.);
Standard_Real ures = myS->UResolution(1.);
Standard_Real vres = myS->VResolution(1.);
tres = aCUAdd / tres;
ures = aSUAdd / ures;
vres = aSVAdd / vres;
Standard_Real minres = Min(tres, Min(ures, vres));
Standard_Real factor = 5.;
Standard_Integer maxnbs = 50;
minres *= factor;
if(minres > Epsilon(1.))
{
if(tres > minres)
{
Standard_Real rsample = mytsample * tres / minres;
if(rsample > maxnbs)
{
mytsample = maxnbs;
}
else
{
mytsample = RealToInt(rsample);
}
aCUAdd = (mytsup - mytmin) / mytsample;
}
if(ures > minres)
{
Standard_Real rsample = myusample * ures / minres;
if(rsample > maxnbs)
{
myusample = maxnbs;
}
else
{
myusample = RealToInt(rsample);
}
aSUAdd = (myusup - myumin) / myusample;
}
if(vres > minres)
{
Standard_Real rsample = myvsample * vres / minres;
if(rsample > maxnbs)
{
myvsample = maxnbs;
}
else
{
myvsample = RealToInt(rsample);
}
aSVAdd = (myvsup - myvmin) / myvsample;
}
}
TColgp_HArray1OfPnt aCPs(1, mytsample);
TColgp_HArray2OfPnt aSPs(1, myusample, 1, myvsample);
Standard_Integer aRestIterCount = 3;

View File

@ -6,6 +6,8 @@ puts ""
# Exception raised during topological operation.
#######################################################################
cpulimit 1500
restore [locate_data_file bug24190_itz.brep] b
bopcheck b

View File

@ -16,7 +16,7 @@ if { [regexp {Debug mode} [dversion]] } {
}
} else {
if { [regexp {Windows} [dversion]] } {
set max_time 50
set max_time 65
} else {
set max_time 80
}

View File

@ -18,7 +18,7 @@ if { [regexp {Debug mode} [dversion]] } {
if { [regexp {Windows} [dversion]] } {
set max_time 100
} else {
set max_time 140
set max_time 160
}
}

View File

@ -16,7 +16,7 @@ if { [regexp {Debug mode} [dversion]] } {
}
} else {
if { [regexp {Windows} [dversion]] } {
set max_time 100
set max_time 110
} else {
set max_time 150
}

View File

@ -0,0 +1,58 @@
puts "================"
puts "OCC24896"
puts "================"
puts ""
#######################################################################
# BRepExtrema is giving wrong intersection point between curve and planar face
#######################################################################
restore [locate_data_file bug24896_face_8.brep] f8
restore [locate_data_file bug24896_compound_line_8.brep] c8
distmini d f8 c8
# 1
regexp {([-0-9.+eE]+)$} [dump d_val] full dist
regexp { +Vertex +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} [ maxtolerance d ] full toler
set good_dist 0
if { [expr abs( ${dist} - ${good_dist} )] > ${toler} } {
puts "Faulty : the distanse is ${dist}. It is bad value"
}
# 2
# Point 3D : 66.6, -11.8556887483839, 0.3
regexp { +Point 3D : +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} [ dump d ] full x1 y1 z1
set good_x1 66.6
set good_y1 -11.8556887483839
set good_z1 0.3
if { [expr abs( ${x1} - ${good_x1} )] > ${toler} } {
puts "Faulty : the x coordinate of the point is ${x1}. It is bad value"
}
if { [expr abs( ${y1} - ${good_y1} )] > ${toler} } {
puts "Faulty : the y coordinate of the point is ${y1}. It is bad value"
}
if { [expr abs( ${z1} - ${good_z1} )] > ${toler} } {
puts "Faulty : the z coordinate of the point is ${z1}. It is bad value"
}
# 3
# Point 3D : 66.6, 11.8556887323157, 0.3
regexp { +Point 3D : +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} [ dump d2 ] full x2 y2 z2
set good_x2 66.6
set good_y2 11.8556887323157
set good_z2 0.3
if { [expr abs( ${x2} - ${good_x2} )] > ${toler} } {
puts "Faulty : the x coordinate of the point is ${x2}. It is bad value"
}
if { [expr abs( ${y2} - ${good_y2} )] > ${toler} } {
puts "Faulty : the y coordinate of the point is ${y2}. It is bad value"
}
if { [expr abs( ${z2} - ${good_z2} )] > ${toler} } {
puts "Faulty : the z coordinate of the point is ${z2}. It is bad value"
}
smallview
fit
set only_screen_axo 1