mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0024134: Wrong result of projection point on the face
Changed Bnd_SphereUBTreeSelector for the Extrema_ExtAlgo_Tree projection algorithm properly work Test case for issue CR24134
This commit is contained in:
parent
42ff8f5bd3
commit
aeaf53d5ed
@ -114,7 +114,8 @@ Standard_Boolean Bnd_SphereUBTreeSelectorMin::Accept(const Standard_Integer& the
|
|||||||
const Bnd_Sphere& aSph = mySphereArray->Value(theInd);
|
const Bnd_Sphere& aSph = mySphereArray->Value(theInd);
|
||||||
Standard_Real aCurDist;
|
Standard_Real aCurDist;
|
||||||
|
|
||||||
if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) < mySol.SquareDistance(myXYZ.XYZ()) )
|
// if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) < mySol.SquareDistance(myXYZ.XYZ()) )
|
||||||
|
if ( (aCurDist = aSph.Distance(myXYZ.XYZ())) < mySol.Distance(myXYZ.XYZ()) )
|
||||||
{
|
{
|
||||||
mySol = aSph;
|
mySol = aSph;
|
||||||
if ( aCurDist < myMinDist )
|
if ( aCurDist < myMinDist )
|
||||||
@ -160,7 +161,8 @@ Standard_Boolean Bnd_SphereUBTreeSelectorMax::Accept(const Standard_Integer& the
|
|||||||
const Bnd_Sphere& aSph = mySphereArray->Value(theInd);
|
const Bnd_Sphere& aSph = mySphereArray->Value(theInd);
|
||||||
Standard_Real aCurDist;
|
Standard_Real aCurDist;
|
||||||
|
|
||||||
if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) > mySol.SquareDistance(myXYZ.XYZ()) )
|
// if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) > mySol.SquareDistance(myXYZ.XYZ()) )
|
||||||
|
if ( (aCurDist = aSph.Distance(myXYZ.XYZ())) > mySol.Distance(myXYZ.XYZ()) )
|
||||||
{
|
{
|
||||||
mySol = aSph;
|
mySol = aSph;
|
||||||
if ( aCurDist > myMaxDist )
|
if ( aCurDist > myMaxDist )
|
||||||
|
34
tests/bugs/moddata_3/bug24134
Normal file
34
tests/bugs/moddata_3/bug24134
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "CR24134"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Wrong result of projection point on the face
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug22109_tore.brep] b
|
||||||
|
explode b f
|
||||||
|
|
||||||
|
copy b_1 f
|
||||||
|
point p 934.419505115097 1387.10553740067 8.42056376938594e-014
|
||||||
|
|
||||||
|
set GOOD_DIST 1.0481408664017105e-12
|
||||||
|
set CMP_TOL 5.0e-12
|
||||||
|
|
||||||
|
# 1
|
||||||
|
set log_t [projponf f p -t]
|
||||||
|
regexp {proj dist = ([-0-9.+eE]+)} ${log_t} full distmax_t
|
||||||
|
if { [expr abs(${distmax_t} - ${GOOD_DIST})] > ${CMP_TOL} } {
|
||||||
|
puts "Error: Wrong intersection point (t-option)"
|
||||||
|
} else {
|
||||||
|
puts "OK: Good intersection point (t-option)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 2
|
||||||
|
set log_g [projponf f p -g]
|
||||||
|
regexp {proj dist = ([-0-9.+eE]+)} ${log_g} full distmax_g
|
||||||
|
if { [expr abs(${distmax_g} - ${GOOD_DIST})] > ${CMP_TOL} } {
|
||||||
|
puts "Error: Wrong intersection point (g-option)"
|
||||||
|
} else {
|
||||||
|
puts "OK: Good intersection point (g-option)"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user