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

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

# right side: faces 2 and 3
# left side: faces 5 and 6

perform_offset_multi_with_ref r0_01 s 0 {2 3 5 6} {1 2 3 4} {620 1000 10 10} 0
perform_offset_multi_with_ref r0_02 s 0 {3 5} {2 3} {550 750 10 10} 0
perform_offset_multi_with_ref r0_03 s 0 {3 6} {2 3} {550 750 10 10} 0
perform_offset_multi_with_ref r0_04 s 0 {2 6} {2 3} {550 750 10 10} 0
perform_offset_multi_with_ref r0_05 s 0 {2 5} {2 3} {550 750 10 10} 0
perform_offset_multi_with_ref r0_06 s 0 {2 3 5 6} {2 2 3 3} {600 1000 8 8} 0
perform_offset_multi_with_ref r0_07 s 0 {2 3 5 6} {3 3 2 2} {600 1000 6 6} 1

perform_offset_multi_with_ref r1_01 s 1 {2 3 5 6} {0 1 2 3} {696 1152 10 10} 0
perform_offset_multi_with_ref r1_02 s 1 {2 3 5 6} {0 2 0 2} {672 1008 10 10} 0
perform_offset_multi_with_ref r1_03 s 1 {2 3 5 6} {2 0 2 0} {672 1008 10 10} 0
perform_offset_multi_with_ref r1_04 s 1 {3 5} {2 2} {696 1152 10 10} 0
perform_offset_multi_with_ref r1_05 s 1 {} {} {624 1008 8 8} 0
perform_offset_multi_with_ref r1_06 s 1 {2 3 5 6} {3 3 2 2} {768 1440 6 6} 1

perform_offset_multi_with_ref r3_01 s 3 {2 6} {0 0} {1120 2048 10 10} 0
perform_offset_multi_with_ref r3_02 s 3 {3 5} {1 1} {1152 2304 10 10} 0
perform_offset_multi_with_ref r3_03 s 3 {2 5} {2 2} {1184 2560 10 10} 0
perform_offset_multi_with_ref r3_04 s 3 {3 6} {0 0} {1120 2048 10 10} 0


# display all created shapes
foreach val {0 1 3} {
  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
