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 1 8 0 1 8 0 4 8 0 7 7 0 7 7 0 5 7 0 1 3 0 1 3 0 3 3 0 7 2 0 7 2 0 4 2 0 1 0 0 1 0 0 0
mkplane f p
prism s f 0 10 0

perform_offset_multi_with_ref r0_01 s 0 {4 5 7 8 10 11 13 14} {0 1 0 1 0 1 0 1} {568 360 22 22} 1
perform_offset_multi_with_ref r0_02 s 0 {7 10} {2 2} {560 300 18 18} 1
perform_offset_multi_with_ref r0_03 s 0 {7 10} {4 2} {568 340 18 16} 1
perform_offset_multi_with_ref r0_04 s 0 {7 10} {4 4} {536 380 16 14} 1
perform_offset_multi_with_ref r0_05 s 0 {7 10} {5 3} {572 360 18 16} 1
perform_offset_multi_with_ref r0_06 s 0 {7 11} {2 2} {568 340 18 16} 1
perform_offset_multi_with_ref r0_07 s 0 {7 11} {3 2} {568 340 18 16} 1
perform_offset_multi_with_ref r0_08 s 0 {7 11} {3 3} {572 360 18 16} 1
perform_offset_multi_with_ref r0_09 s 0 {7 11} {0 4} {536 380 16 14} 1

perform_offset_multi_with_ref r1_01 s 1 {4 5 7 8 10 11 13 14} {0 1.5 0 1.5 0 1.5 0 1.5} {858 828 22 22} 1
perform_offset_multi_with_ref r1_02 s 1 {7 10} {2 2} {824 912 18 18} 1
perform_offset_multi_with_ref r1_03 s 1 {7 10} {4 4} {760 960 16 14} 1
perform_offset_multi_with_ref r1_04 s 1 {7 11} {0 4} {740 984 16 14} 1

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

copy r0_01 result
copy r0_01_unif result_unif
