#!/bin/bash inpsvg="$1" sf='1' if [[ "$2" != "" ]] ; then sf="$2" fi premul=`echo "1000000" | bc -l` invmul=`echo "( 1 / $premul ) * $sf" | bc -l` frapid="F800" fslow="F150" S="1.0" if [[ "$inpsvg" == "" ]] ; then echo "provide input svg" exit 1 fi rawtype=`file $inpsvg` checktype=`file -b $inpsvg | cut -f1 -d' '` if [[ "$checktype" != "SVG" ]] ; then echo -e "file $inpsvg is of type:\n\n$rawtype\n\nNnot an SVG file? Exiting.\n" exit 1 fi bn=`basename $inpsvg .svg` # causes duplicate paths otherwise # sed -i 's/fill="[^"]*"/fill="none"/g' $inpsvg echo "creating $bn.ps" rsvg-convert -f ps -o $bn.ps $inpsvg pstoedit -f gnuplot $bn.ps $bn.gp zplunge="-6.5" zraise="10" bitr=`echo "$premul*1.5/2" | bc -l` rm -f {$bn}-ord.gp #clipcli -s $bn.gp -F $premul -R "$bitr" -T >> ${bn}-ord.gp clipcli -s $bn.gp -F -x $premul -R "0.75" -T >> ${bn}-ord.gp rm -f ${bn}.ngc echo -e "G90\nG21\nG1 Z$zraise" >> ${bn}.ngc echo "gp2ngc --preset 3040 --z-raise "$zplunge" --z-plunge "$zraise" -i ${bn}-ord.gp -->> ${bn}.ngc" gp2ngc \ --preset 3040 \ --z-raise "$zraise" \ --z-plunge "$zplunge" \ --slow "$fslow" \ --rapid "$frapid" \ --premul "$invmul" \ -i ${bn}-ord.gp >> ${bn}.ngc