1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0027190: IntPatch_ImpPrmIntersection algorithm does not split intersection curve by the seam-edge of the quadric

1. Processing when IntPatch_WLine/IntPatch_RLine goes through the seam edge has been improved in DecomposeResult(...) function (see IntPatch_ImpPrmIntersection.cxx).
2. Incorrect initialization of last point of IntPatch_WLine/IntPatch_RLine has been eliminated. Earlier it was the reason of exception.

Creation of test case for this issue.

Adjusting some test cases according to their new behavior. Namely:

1) tests\bugs\modalg_4\bug825 (bug825_2)
Details are described in issue #25915. In short, new intersection algorithm works better than old (WLine without "jumping"). However, Boolean operation loses degenerated edges of the sphere. Consequently, we get the result with Not-closed face.

2) tests\bugs\modalg_6\bug26684_2
TolReached of intersection curve has become smaller. Consequently, intersection algorithm works better than earlier.
This commit is contained in:
nbv
2016-02-24 12:59:36 +03:00
committed by abv
parent 716037dd9c
commit a09c8f3aa5
6 changed files with 577 additions and 123 deletions

View File

@@ -1,5 +1,6 @@
puts "TODO OCC25915 ALL: Faulty OCC825"
puts "TODO OCC25915 ALL: Error : The command is not valid. The area is"
puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_"
pload QAcommands

View File

@@ -1,3 +1,5 @@
puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_"
pload QAcommands
puts "========"
@@ -23,6 +25,6 @@ if { [ catch { set info_result [OCC825 a1 a2 a3 a4 a5] } ] } {
}
}
checkprops result -s 7853.92
checkprops result -s 5890.48
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -26,6 +26,6 @@ checkreal "Reached tolerance" ${Tolerance} 1.2530391548405894e-008 1.e-7 0
set bop_info_2d [bopcurves f1 f2 -2d]
regexp {Tolerance Reached=([-0-9.+eE]+)} $bop_info_2d full Tolerance_2d
checkreal "Reached tolerance" ${Tolerance_2d} 1.8067758590039568e-005 0 1.e-2
checkreal "Reached tolerance" ${Tolerance_2d} 1.4134494834137484e-005 0 1.e-2
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,66 @@
puts "================"
puts "OCC27190"
puts "================"
puts ""
#######################################################################
# IntPatch_ImpPrmIntersection algorithm does not split intersection curve by the seam-edge of the quadric
#######################################################################
set MaxTol 1.e-3
set GoodNbCurv 11
restore [locate_data_file bug27167-pipe.brep] a1
pcylinder a2 100 300
explode a1 f
explode a2 f
set log [bopcurves a1_2 a2_1 -2d]
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!"
}
set Period [dval 2*pi]
for {set i 1} {$i <= ${NbCurv}} {incr i} {
bounds c2d2_$i u1 u2
2dcvalue c2d2_$i u1 x1 y
2dcvalue c2d2_$i u2 x2 y
set X1 [dval x1/$Period]
set X2 [dval x2/$Period]
# Example: x1 = 5.3*pi, x2 = 12.8*pi ==> [x1, x2] intersects seam
if { [expr abs($X1 - $X2) > 1.0] } {
puts "Error: c2d2_$i intersects seam (0.0 or $Period): x1=[dval x1], x2=[dval x2]"
continue;
}
set iX1 [expr floor($X1)]
set iX2 [expr floor($X2)]
# Examples:
# 1. x1 = 5*pi/2, x2 = 3*pi ==> [x1, x2] does not intersect seam and
# ($iX1 == $iX2 == 0). I.e. if ($iX1 == $iX2) then seam is not intersected.
# 2. x1 = 3*pi, x2 = 5*pi ==> [x1, x2] intersects seam and
# ($iX1 == 1, $iX2 == 2) ==> ($iX1 != $iX2).
# 3. x1 = pi/4, x2 = 2*pi ==> [x1, x2] does not intersect seam and
# ($iX1 == 0, $iX2 == 1) ==> ($iX1 != $iX2) and ($X2 == $iX2 = 1)
if { ($iX1 != $iX2) && ($X2 != $iX2) } {
puts "Error: c2d2_$i intersects seam (0.0 or $Period): x1=[dval x1], x2=[dval x2]"
}
}
smallview
don c_*
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png