Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env sh
- # Proof of concept ISSF (International Shooting Sport Federation, incl. Olympia) 10m air rifle target with ImageMagick and bc.
- # Dimensions not verified. Not printed yet, tested only on screen.
- #
- # http://www.issf-sports.org/documents/rules/2017/ISSFRuleBook2017-2ndPrintV1.1-ENG.zip
- # 6.3.4.3 - 10m Air Rifle Target
- #
- #10 Ring 0.5 mm (±0.1 mm)
- # 9 Ring 5.5 mm (±0.1 mm)
- # 8 Ring 10.5 mm (±0.1 mm)
- # 7 Ring 15.5 mm (±0.1 mm)
- # 6 Ring 20.5 mm (±0.1 mm)
- # 5 Ring 25.5 mm (±0.1 mm)
- # 4 Ring 30.5 mm (±0.1 mm)
- # 3 Ring 35.5 mm (±0.1 mm)
- # 2 Ring 40.5 mm (±0.1 mm)
- # 1 Ring 45.5 mm (±0.1 mm)
- #Inner Ten: When the 10 ring (dot) has been shot out completely as determined
- # by the use of an Air Pistol OUTWARD scoring gauge.
- #Black from 4 to 9 rings = 30.5 mm (±0.1 mm).
- #The ten ring is a white dot = 0.5 mm (±0.1 mm).
- #Ring thickness: 0.1 mm to 0.2 mm.
- #Minimum visible size of target card: 80 mm x 80 mm.
- #Scoring ring values 1 – 8 are printed in the scoring zones in vertical and horizontal
- # lines, at right angles to each other. The 9 point zone is not marked with a number.
- #The 10 is a white dot.
- #Background cards 170 mm x 170 mm, similar in color to the target material should
- # be provided to improve the visibility of the target.
- #
- # 6.4.6.1 - Height of Target Centers
- # 1.40 m (±0.05 m)
- #
- # https://en.wikipedia.org/wiki/ISSF_10_meter_air_rifle
- ## Target card size in mm
- DPI=96
- WIDTH=140
- HEIGHT=140
- a=$(echo "$DPI * $WIDTH / 25.4" | bc -l)
- b=$(echo "$DPI * $HEIGHT / 25.4" | bc -l)
- ahalf=$(echo "$a/2" | bc -l)
- bhalf=$(echo "$b/2" | bc -l)
- # Ring thickness
- rt=$(echo "$DPI * 0.15 / 25.4" | bc -l)
- one=$(echo "$DPI * 45.5 / 25.4" | bc -l)
- n1=$(echo "$one - ($DPI * 2.5 / 25.4)" | bc -l)
- c1=$(echo "$bhalf + $one" | bc -l)
- two=$(echo "$DPI * 40.5 / 25.4" | bc -l)
- n2=$(echo "$two - ($DPI * 2.5 / 25.4)" | bc -l)
- c2=$(echo "$bhalf + $two" | bc -l)
- three=$(echo "$DPI * 35.5 / 25.4" | bc -l)
- n3=$(echo "$three - ($DPI * 2.5 / 25.4)" | bc -l)
- c3=$(echo "$bhalf + $three" | bc -l)
- four=$(echo "$DPI * 30.5 / 25.4" | bc -l)
- n4=$(echo "$four - ($DPI * 2.5 / 25.4)" | bc -l)
- c4=$(echo "$bhalf + $four" | bc -l)
- five=$(echo "$DPI * 25.5 / 25.4" | bc -l)
- n5=$(echo "$five - ($DPI * 2.5 / 25.4)" | bc -l)
- c5=$(echo "$bhalf + $five" | bc -l)
- six=$(echo "$DPI * 20.5 / 25.4" | bc -l)
- n6=$(echo "$six - ($DPI * 2.5 / 25.4)" | bc -l)
- c6=$(echo "$bhalf + $six" | bc -l)
- seven=$(echo "$DPI * 15.5 / 25.4" | bc -l)
- n7=$(echo "$seven - ($DPI * 2.5 / 25.4)" | bc -l)
- c7=$(echo "$bhalf + $seven" | bc -l)
- eight=$(echo "$DPI * 10.5 / 25.4" | bc -l)
- n8=$(echo "$eight - ($DPI * 2.5 / 25.4)" | bc -l)
- c8=$(echo "$bhalf + $eight" | bc -l)
- nine=$(echo "$DPI * 5.5 / 25.4" | bc -l)
- #n9=$(echo "$nine - ($DPI * 2.5 / 25.4)" | bc -l)
- c9=$(echo "$bhalf + $nine" | bc -l)
- ten=$(echo "$DPI * 0.5 / 25.4" | bc -l)
- #n10=$(echo "$nine - ($DPI * 2.5 / 25.4)" | bc -l)
- c10=$(echo "$bhalf + $ten" | bc -l)
- ## 'One-Liner' ###
- convert -size "$a"x"$b" xc:transparent \
- \
- -fill none -draw 'stroke black stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c1'' \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n1",0 '1'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n1",0 '1'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n1" '1'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n1" '1'" \
- \
- -fill none -draw 'stroke black stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c2'' \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n2",0 '2'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n2",0 '2'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n2" '2'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n2" '2'" \
- \
- -fill none -draw 'stroke black stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c3'' \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n3",0 '3'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n3",0 '3'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n3" '3'" \
- -fill black -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n3" '3'" \
- \
- -fill black -draw 'stroke black stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c4'' \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n4",0 '4'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n4",0 '4'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n4" '4'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n4" '4'" \
- \
- -fill black -draw 'stroke white stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c5'' \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n5",0 '5'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n5",0 '5'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n5" '5'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n5" '5'" \
- \
- -fill black -draw 'stroke white stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c6'' \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n6",0 '6'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n6",0 '6'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n6" '6'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n6" '6'" \
- \
- -fill black -draw 'stroke white stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c7'' \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n7",0 '7'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n7",0 '7'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n7" '7'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n7" '7'" \
- \
- -fill black -draw 'stroke white stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c8'' \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text "$n8",0 '8'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text -"$n8",0 '8'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,"$n8" '8'" \
- -fill white -density $DPI -pointsize 12 -gravity center -font DIN-1451-Engschrift -draw "text 0,-"$n8" '8'" \
- \
- -fill black -draw 'stroke white stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c9'' \
- \
- -fill white -draw 'stroke white stroke-width '$rt' circle '$ahalf','$bhalf' '$ahalf','$c10'' \
- \
- -fill none -draw 'stroke green stroke-width .1 stroke-dasharray 2 2 rectangle '$ahalf','$bhalf' '$c1','$c1'' \
- \
- -density $DPI ISSF-10mAirRifleTarget.png
- echo "a = $a"
- echo "b = $b"
- echo "ahalf = $ahalf"
- echo "bhalf = $bhalf"
- echo "rt = $rt"
- echo "one = $one"
- echo "n1 = $n1"
- echo "c1 = $c1"
- echo "..."
- # Show picture resolution
- # identify -format "%w x %h %x x %y" ISSF-10mAirRifle.png
- #
- # Show monitor resolution
- # xdpyinfo | grep -B 2 resolution
- #
- # https://aur.archlinux.org/packages/ttf-din1451/
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement