puts "========"
puts "0031148: Offset adjacent co-planar faces with different offset values"
puts "========"
puts ""

pload MODELING

# unset draw variables for all offset values
foreach val {0 1 2 3} {
  foreach x [directory r${val}*_unif] {
    unset $x
  }
}

polyline p 0 0 0 10 0 0 10 0 5 5 0 5 0 0 5 0 0 0
mkplane f p
prism s f 0 10 0

perform_offset_multi_with_ref r0_01 s 0 {3 4} {1 2} {470 650 8 8} 0
perform_offset_multi_with_ref r0_02 s 0 {3 4} {2 1} {470 650 8 8} 0
perform_offset_multi_with_ref r0_03 s 0 {3 4} {2 2} {480 700 7 7} 0

perform_offset_multi_with_ref r1_01 s 1 {3 4} {2 3} {708 1224 8 8} 0
perform_offset_multi_with_ref r1_02 s 1 {3 4} {3 2} {708 1224 8 8} 0

perform_offset_multi_with_ref r2_01 s 2 {3 4} {4 4} {1008 2156 7 7} 0
perform_offset_multi_with_ref r2_02 s 2 {} {} {896 1764 7 7} 0
perform_offset_multi_with_ref r2_03 s 2 {3 4} {0 1} {826 1470 8 8} 0
perform_offset_multi_with_ref r2_04 s 2 {3 4} {1 1} {840 1568 7 7} 0

perform_offset_multi_with_ref r3_01 s 3 {4} {5} {1312 3072 8 8} 0


# display all created shapes
foreach val {0 1 2 3} {
  foreach x [directory r${val}*_unif] {
    if {[isdraw $x]} {
      checkview -display $x -2d -path ${imagedir}/${test_image}_$x.png
    }
  }
}

copy r3_01 result
copy r3_01_unif result_unif
