
puts "========"
puts "BUC60852"
puts "BUC60923"
puts "========"

pload QAcommands

set bndbox_X1 0
set bndbox_Y1 0
set bndbox_Z1 0
set bndbox_X2 30
set bndbox_Y2 10
set bndbox_Z2 20

set point_1_1_X -20
set point_1_1_Y -5
set point_1_1_Z 10
set point_1_2_X 50
set point_1_2_Y 15
set point_1_2_Z 10

vertex vertex_1_1 $point_1_1_X $point_1_1_Y $point_1_1_Z
vertex vertex_1_2 $point_1_2_X $point_1_2_Y $point_1_2_Z

edge edge_1 vertex_1_1 vertex_1_2

puts ""

set point_2_1_X -20
set point_2_1_Y -10
set point_2_1_Z 10
set point_2_2_X 50
set point_2_2_Y -10
set point_2_2_Z 10

vertex vertex_2_1 $point_2_1_X $point_2_1_Y $point_2_1_Z
vertex vertex_2_2 $point_2_2_X $point_2_2_Y $point_2_2_Z

edge edge_2 vertex_2_1 vertex_2_2

puts ""

box bndbox $bndbox_X1 $bndbox_Y1 $bndbox_Z1 $bndbox_X2 $bndbox_Y2 $bndbox_Z2


line line_1 $point_1_1_X $point_1_1_Y $point_1_1_Z [ expr { $point_1_1_X - $point_1_2_X } ] [ expr { $point_1_1_Y - $point_1_2_Y } ] [ expr { $point_1_1_Z - $point_1_2_Z } ]

line line_2 $point_2_1_X $point_2_1_Y $point_2_1_Z [ expr { $point_2_1_X - $point_2_2_X } ] [ expr { $point_2_1_Y - $point_2_2_Y } ] [ expr { $point_2_1_Z - $point_2_2_Z } ]

puts ""

set result1 [BUC60852 edge_1 $bndbox_X1 $bndbox_Y1 $bndbox_Z1 $bndbox_X2 $bndbox_Y2 $bndbox_Z2]
if {${result1} != "Line that lies on edge intersects the box\n"} {
  puts "BUC60852: Error; (case 1)"
} else {
  puts "BUC60852: OK; (case 1)"
}

puts ""

set result2 [BUC60852 edge_2 $bndbox_X1 $bndbox_Y1 $bndbox_Z1 $bndbox_X2 $bndbox_Y2 $bndbox_Z2]
if {${result2} != "Line that lies on edge does not intersect the box\n"} {
  puts "BUC60852: Error; (case 2)"
} else {
  puts "BUC60852: OK; (case 2)"
}

