mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0025950: Bad performance of intersection algorithm.
1. Test case has been created. 2. Minor correction in DrawTrSurf.cxx file.
This commit is contained in:
parent
ce1c28b8b4
commit
364c88864b
@ -284,7 +284,7 @@ static Standard_Integer drawpoles(Draw_Interpretor&,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( n<2) return 1;
|
if ( n<2) return 0;
|
||||||
|
|
||||||
Handle(DrawTrSurf_BezierSurface) BZS;
|
Handle(DrawTrSurf_BezierSurface) BZS;
|
||||||
BZS = GetBezierSurface(a[1]);
|
BZS = GetBezierSurface(a[1]);
|
||||||
|
@ -48,3 +48,27 @@ proc CheckIntersectionResult {theSurf1 theSurf2 theListOfCurves theNbPoints theT
|
|||||||
xdistcs aCurve s2 U1 U2 $theNbPoints $theTolerS2
|
xdistcs aCurve s2 U1 U2 $theNbPoints $theTolerS2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check whether given list contain overlapped curves
|
||||||
|
help CheckOverlapIntCurves { theListOfCurves }
|
||||||
|
proc CheckOverlapIntCurves { theListOfCurves {theTolerance 1.0e-7} } {
|
||||||
|
set NbEdges [expr [llength $theListOfCurves] - 1 ]
|
||||||
|
for { set i1 0 } { $i1 < $NbEdges } { incr i1 } {
|
||||||
|
for { set i2 [expr $i1 + 1] } { $i2 <= $NbEdges } { incr i2 } {
|
||||||
|
upvar #0 [ lindex $theListOfCurves $i1 ] aCurve1
|
||||||
|
upvar #0 [ lindex $theListOfCurves $i2 ] aCurve2
|
||||||
|
|
||||||
|
mkedge e1 aCurve1
|
||||||
|
mkedge e2 aCurve2
|
||||||
|
|
||||||
|
set coe [ checkoverlapedges e1 e2 $theTolerance ]
|
||||||
|
|
||||||
|
if { [regexp "Edges is not overlaped" $coe] != 1 } {
|
||||||
|
set cIdx1 [ expr $i1 + 1 ]
|
||||||
|
set cIdx2 [ expr $i2 + 1 ]
|
||||||
|
|
||||||
|
puts "Error: Curves $cIdx1 and $cIdx2 are overlapped"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
puts "========"
|
puts "========"
|
||||||
puts "OCC21494"
|
puts "OCC21494: Intersection between cone and sphere fails"
|
||||||
puts "========"
|
puts "========"
|
||||||
puts ""
|
puts ""
|
||||||
############################################
|
|
||||||
# Intersection between cone and sphere fails
|
|
||||||
############################################
|
|
||||||
|
|
||||||
foreach a [directory res*] {unset $a}
|
foreach a [directory res*] {unset $a}
|
||||||
|
|
||||||
|
88
tests/lowalgos/intss/bug25950
Normal file
88
tests/lowalgos/intss/bug25950
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
puts "========="
|
||||||
|
puts "0025950: Bad performance of intersection algorithm."
|
||||||
|
puts "========="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
cpulimit 200
|
||||||
|
|
||||||
|
puts "TODO 0025950 ALL: Error: 0 vertices are expected but 2 are found."
|
||||||
|
puts "TODO 0025950 ALL: Error : The length of result shape is 18.8605"
|
||||||
|
|
||||||
|
set aGoodNbCurves 3
|
||||||
|
|
||||||
|
foreach a [directory res*] {unset $a}
|
||||||
|
|
||||||
|
restore [locate_data_file bug25950_b1.brep] b1
|
||||||
|
restore [locate_data_file bug25950_b2.brep] b2
|
||||||
|
|
||||||
|
mksurface s1 b1
|
||||||
|
mksurface s2 b2
|
||||||
|
|
||||||
|
don s1 s2
|
||||||
|
clpoles s1
|
||||||
|
clpoles s2
|
||||||
|
clknots
|
||||||
|
|
||||||
|
dchrono z reset
|
||||||
|
dchrono z start
|
||||||
|
|
||||||
|
intersect res s1 s2
|
||||||
|
|
||||||
|
dchrono z stop counter Bug25950IntSS
|
||||||
|
dchrono z show
|
||||||
|
|
||||||
|
smallview +Y+Z
|
||||||
|
fit
|
||||||
|
checkview -screenshot -2d -path ${imagedir}/${test_image}_2d.png
|
||||||
|
|
||||||
|
set che [whatis res]
|
||||||
|
set ind [string first "3d curve" $che]
|
||||||
|
if {${ind} >= 0} {
|
||||||
|
#Only variable "res" exists
|
||||||
|
renamevar res res_1
|
||||||
|
}
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
compound IntEdges
|
||||||
|
|
||||||
|
set CurvesList {}
|
||||||
|
|
||||||
|
set ic 1
|
||||||
|
set AllowRepeat 1
|
||||||
|
while { $AllowRepeat != 0 } {
|
||||||
|
set che [whatis res_$ic]
|
||||||
|
set ind [string first "3d curve" $che]
|
||||||
|
if {${ind} < 0} {
|
||||||
|
set AllowRepeat 0
|
||||||
|
} else {
|
||||||
|
lappend CurvesList res_$ic
|
||||||
|
mkedge ee res_$ic
|
||||||
|
baddobjects ee
|
||||||
|
incr ic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set ic [expr $ic - 1]
|
||||||
|
|
||||||
|
if { $ic != $aGoodNbCurves } {
|
||||||
|
puts "Error: $aGoodNbCurves curves is expected but $ic ones are found"
|
||||||
|
} else {
|
||||||
|
CheckIntersectionResult s1 s2 $CurvesList 100 7.0e-5 2.0e-4
|
||||||
|
CheckOverlapIntCurves $CurvesList
|
||||||
|
if {$ic > 1} {
|
||||||
|
bfillds
|
||||||
|
bbuild result
|
||||||
|
} elseif {$ic > 0} {
|
||||||
|
mkedge result res_1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check gaps between intersection curves
|
||||||
|
checksection result -r 0
|
||||||
|
checkmaxtol result -min_tol 2.0e-7
|
||||||
|
|
||||||
|
checknbshapes result -edge 3 -vertex 4
|
||||||
|
checkprops result -l 37.721
|
||||||
|
}
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}_3d.png
|
Loading…
x
Reference in New Issue
Block a user