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} {
  foreach x [directory r${val}*_unif] {
    unset $x
  }
}

polyline p 0 0 0 10 0 0 10 0 2 8 0 2 6 0 2 6 0 5 6 0 8 4 0 8 4 0 5 4 0 2 2 0 2 0 0 2 0 0 0
mkplane f p
prism s f 0 10 0

# right top side: faces 3 and 4
# right side: faces 5 and 6
# left side: faces 8 and 9
# left top side: faces 10 and 11

perform_offset_multi_with_ref r0_01 s 0 {3 6 8 11} {3 2 2 3} {672 560 22 18} 1
perform_offset_multi_with_ref r0_02 s 0 {3 6 8 11} {3 3 3 3} {684 620 22 18} 1
perform_offset_multi_with_ref r0_03 s 0 {3 6 8 11} {4 2 2 4} {680 600 22 18} 1
perform_offset_multi_with_ref r0_04 s 0 {3 6 8 11} {3 4 4 3} {696 680 18 14} 1
perform_offset_multi_with_ref r0_05 s 0 {3 6 8 11} {3 5 5 3} {748 740 22 18} 1

perform_offset_multi_with_ref r1_01 s 1 {3 6 8 11} {3 2 2 3} {856 1104 22 18} 1
perform_offset_multi_with_ref r1_02 s 1 {3 6 8 11} {4 2 2 4} {868 1176 22 18} 1
perform_offset_multi_with_ref r1_03 s 1 {3 6 8 11} {3 3 3 3} {872 1200 22 18} 1
perform_offset_multi_with_ref r1_04 s 1 {3 6 8 11} {3 4 4 3} {888 1296 22 18} 1
perform_offset_multi_with_ref r1_05 s 1 {3 6 8 11} {3 5 5 3} {904 1392 18 14} 1
perform_offset_multi_with_ref r1_06 s 1 {3 6 8 11} {7 2 2 7} {904 1392 18 14} 1

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

copy r1_02 result
copy r1_02_unif result_unif
