puts "================" puts "OCC23051" puts "================" puts "" ###################################################################################### # Bug in BRepExtrema_DistShapeShape (through BRepExtrema_DistanceSS0 ###################################################################################### set BugNumber OCC23051 # create edges and find minimal distance plane p 0 0 0 0 0 1 mkface f p -10 10 -10 10 vertex v 0 0 1 set res [distmini r f v] # result should contain one edge, starting on f and ending on v if { [llength $res] != 2 } { puts "Error: result has structure different from expected: $res" } # get start and end vertices -- these should be solutions on f and v set sol [explode [lindex $res 1] v] set status1 0 # check distances in correct order set d1 [dval [lindex [distmini d1 [lindex $sol 0] f] 0]] set d2 [dval [lindex [distmini d2 [lindex $sol 1] v] 0]] puts "Distances from solutions to relevant objecte: $d1, $d2" if { $d1 > 1e-7 || $d2 > 1e-7 } { puts "Error: distances are non-zero!" set status1 1 } set status2 0 # check distances in swapped order set d1 [dval [lindex [distmini d1 [lindex $sol 0] v] 0]] set d2 [dval [lindex [distmini d2 [lindex $sol 1] f] 0]] puts "Distances from solutions to swapped objecte: $d1, $d2" if { $d1 < 0.1 || $d2 < 0.1 } { puts "Error: swapped distances are zero, i.e. solutions are swapped!" set status2 1 } # Resume puts "" if { ${status1} != 0 && ${status2} != 0 } { puts "Faulty ${BugNumber}" } else { puts "OK ${BugNumber}" }