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 11 0 0 11 0 1 9 0 1 9 0 4 9 0 7 8 0 7 8 0 4 8 0 1 6 0 1 5 0 1 3 0 1 3 0 4 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 9 10 11 12 13 15 16} {1 2 2 1 1 2 1 1 2 2 1} {686 630 26 26} 1
perform_offset_multi_with_ref r0_02 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 3 1 1 2 2 1} {708 640 30 26} 1
perform_offset_multi_with_ref r0_03 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 4 1 1 2 2 1} {690 650 30 26} 1
perform_offset_multi_with_ref r0_04 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 8 1 1 2 2 1} {698 690 30 26} 1
perform_offset_multi_with_ref r0_05 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.1 1 1 4 1 1 2.1 2 1} {690.8 654 30 26} 1
perform_offset_multi_with_ref r0_06 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.5 1 1 4 1 1 2.5 2 1} {654 670 26 22} 1
perform_offset_multi_with_ref r0_07 s 0 {4 5 7 8 9 10 11 12 13 15 16} {1 2 3 1 1 4 1 1 3 2 1} {654 670 26 22} 1
perform_offset_multi_with_ref r0_08 s 0 {8 10 12} {2 1 2} {532 360 18 18} 1
perform_offset_multi_with_ref r0_09 s 0 {8 10 12} {2.2 1 2.2} {533.6 368 18 18} 1
perform_offset_multi_with_ref r0_10 s 0 {8 10 12} {2.5 1 2.5} {496 380 14 14} 1
perform_offset_multi_with_ref r0_11 s 0 {8 10 12} {3 3 3} {496 380 14 14} 1
perform_offset_multi_with_ref r0_12 s 0 {7 10 13} {2 3 2} {696 380 26 22} 1
perform_offset_multi_with_ref r0_13 s 0 {7 10 13} {2 5 2} {660 400 26 22} 1
perform_offset_multi_with_ref r0_14 s 0 {7 10 13} {2.5 3 2.5} {642 410 22 18} 1
perform_offset_multi_with_ref r0_15 s 0 {7 10 13} {2.5 5 2.5} {642 410 22 18} 1
perform_offset_multi_with_ref r0_16 s 0 {7 10 13} {3 5 3} {642 410 22 18} 1

perform_offset_multi_with_ref r1_01 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 2 1 1 2 2 1} {976 1104 26 26} 1
perform_offset_multi_with_ref r1_02 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2 1 1 3 1 1 2 2 1} {1002 1116 30 26} 1
perform_offset_multi_with_ref r1_05 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.1 1 1 4 1 1 2.1 2 1} {981.2 1135.2 30 26} 1
perform_offset_multi_with_ref r1_06 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 2.5 1 1 4 1 1 2.5 2 1} {914 1164 26 22} 1
perform_offset_multi_with_ref r1_07 s 1 {4 5 7 8 9 10 11 12 13 15 16} {1 2 3 1 1 4 1 1 3 2 1} {914 1164 26 22} 1
perform_offset_multi_with_ref r1_08 s 1 {8 10 12} {2 2 2} {808 960 18 18} 1
perform_offset_multi_with_ref r1_09 s 1 {8 10 12} {2.2 1 2.2} {831.6 957.6 18 18} 1
perform_offset_multi_with_ref r1_10 s 1 {8 10 12} {2.5 1 2.5} {786 972 14 14} 1
perform_offset_multi_with_ref r1_11 s 1 {8 10 12} {3 3 3} {786 972 14 14} 1
perform_offset_multi_with_ref r1_12 s 1 {7 10 13} {2 3 2} {938 1020 26 22} 1
perform_offset_multi_with_ref r1_15 s 1 {7 10 13} {2.5 5 2.5} {850 1068 22 18} 1
perform_offset_multi_with_ref r1_16 s 1 {7 10 13} {3 5 3} {850 1068 22 18} 1

perform_offset_multi_with_ref r2_01 s 2 {} {} {1166 1890 14 14} 1
perform_offset_multi_with_ref r3_01 s 3 {5 15} {6 6} {1490 3728 10 10} 1

# display all created shapes
set i 1
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
      incr i
    }
  }
}

copy r0_01 result
copy r0_01_unif result_unif
