Skip to content

Instantly share code, notes, and snippets.

@wtnb75
Created November 10, 2015 16:53
Show Gist options
  • Save wtnb75/350e94cdee04733ac36e to your computer and use it in GitHub Desktop.
Save wtnb75/350e94cdee04733ac36e to your computer and use it in GitHub Desktop.
MicroPrint + Slic3r
#! /bin/sh
for i; do
#awk '{print;}/move to next layer/{ly=$(NF);gsub("[()]","",ly);print ";LAYER:"ly;}' ${i} > ${i}.new
awk 'BEGIN{ly=0;}{print;}/^G1 Z/{ly++;print ";LAYER:"ly;}' ${i} > ${i}.new
if cmp ${i} ${i}.new > /dev/null ; then
rm ${i}.new
else
mv $i ${i}.bak
mv ${i}.new ${i}
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment