1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00
occt/tests/bugs/modalg_6/bug27190
nbv a09c8f3aa5 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.
2016-03-18 07:11:00 +03:00

67 lines
1.8 KiB
Plaintext

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