1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-07-30 13:05:50 +03:00
occt/tests/bugs/modalg_5/bug24472
nbv 00302ba4e7 0024472: Wrong section curves
1. Checking, if intersection curve is collapsed, is added. (file GeomInt_LineConstructor.cxx)
2. Earlier, intersection line was considered as valid if only mid-point of every interval of this line is into two intersected surfaces (with given tolerance). That's no good because after inserting of new points, old points, which is considered as valid only because they are into beginning or into end of interval (therefore, they was not checked), moved to mid of interval and became invalid. Therefore, checking for first and last points was added. (file GeomInt_LineConstructor.cxx)
3. Intersection line became valid (see bug description) after adding of new additional points into it (file IntPatch_PrmPrmIntersection.cxx). Methods for finding and adding of new points were added. (file IntWalk_PWalking_1.gxx)
Some test cases were changed.
Test cases for issue CR24472
2014-02-07 11:15:22 +04:00

113 lines
1.9 KiB
Plaintext
Executable File

puts "========="
puts "CR24472"
puts "========="
puts ""
###############################
## Wrong section curves
###############################
proc checkList {List Tolerance D_good} {
set L1 [llength ${List}]
set L2 10
set L3 5
set N [expr (${L1} - ${L2})/${L3} + 1]
for {set i 1} {${i} <= ${N}} {incr i} {
set j1 [expr ${L2} + (${i}-1)*${L3}]
set j2 [expr ${j1} + 2]
set T [lindex ${List} ${j1}]
set D [lindex ${List} ${j2}]
#puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
puts "Error: i=${i} T=${T} D=${D}"
}
}
}
smallview
restore [locate_data_file bug24472_Pipe_1.brep] b1
explode b1 f
copy b1_2 f1
copy b1_3 f2
copy b1_6 f3
mksurface s1 f1
mksurface s2 f2
mksurface s3 f3
puts ""
puts "First test"
# 1.1 geometry
intersect i s1 s2
#donly i_22; fit
dlog reset
dlog on
xdistcs i_22 s1 0 1 10
set Log1 [dlog get]
set List1 [split ${Log1} {TD= \t\n}]
set Tolerance 1.0e-12
set D_good 0.
checkList ${List1} ${Tolerance} ${D_good}
puts ""
puts "Second test"
# 1.2 topology
bsection r f1 f2
bopcheck r
# r is self interfered
explode r e
mkcurve c r_1
#donly r_1; fit
dlog reset
dlog on
xdistcs c s1 0.0714822451660209 1 10
set Log2 [dlog get]
set List2 [split ${Log2} {TD= \t\n}]
set Tolerance 1.0e-12
set D_good 0.
checkList ${List2} ${Tolerance} ${D_good}
puts ""
puts "Third test"
# 2.1 geometry
intersect i s1 s3
#donly i_4; fit
dlog reset
dlog on
xdistcs i_4 s1 0 1 10
set Log3 [dlog get]
set List3 [split ${Log3} {TD= \t\n}]
set Tolerance 1.0e-6
set D_good 0.
checkList ${List3} ${Tolerance} ${D_good}
puts ""
puts "Fourth test"
# 2.2 topology
bsection r f1 f3
bopcheck r
#r is self interfered
explode r
mkcurve c r_1
#donly r_1; fit
dlog reset
dlog on
xdistcs c s1 0.0714822451660209 1 10
set Log4 [dlog get]
set List4 [split ${Log4} {TD= \t\n}]
set Tolerance 1.0e-12
set D_good 0.
checkList ${List4} ${Tolerance} ${D_good}