1 puts "========================"
3 puts "========================"
5 #######################################################################
6 # Problem in BRepExtrema_DistShapeShape
8 # This script tries to reproduce the bug in BRepExtrema_DistanceSS class reported
9 # by Rob Bacnrach on OCCT Forum: http://www.opencascade.org/org/forum/thread_23040
10 # (when first shape is edge and second is vertex, the points are returned
11 # for the solutions are swapped)
13 #######################################################################
15 set BugNumber OCC22758
17 bsplinecurve c1 2 2 0 3 1 3 0 2 0 1 1 1 0 1 2 2 0 1
24 # result should contain one edge, starting on e and ending on v
25 #if { [llength $res] != 2 } {
26 # puts "Error: result has structure different from expected: $res"
30 # get start and end vertices -- these should be solutions on e1 and e2
33 # check distances in correct order
34 distmini d1 [lindex $sol 0] e
35 distmini d2 [lindex $sol 1] v
38 puts "Distances from solutions to relevant objects: $d1, $d2"
39 if { $d1 > 1e-7 || $d2 > 1e-7 } {
40 puts "Error: distances are non-zero!"
44 # check distances in swapped order
45 distmini d1 [lindex $sol 0] v
46 distmini d2 [lindex $sol 1] e
49 puts "Distances from solutions to swapped objects: $d1, $d2"
50 if { $d1 < 0.1 || $d2 < 0.1 } {
51 puts "Error: swapped distances are zero, i.e. solutions are swapped!"
57 if { ${status} == 1 } {
58 puts "Faulty ${BugNumber}"
60 puts "OK ${BugNumber}"