Skip to content

Instantly share code, notes, and snippets.

@datapaganism
datapaganism / patch_stl.sh
Last active August 15, 2022 14:23
Takes two parameters, the original STL file and a patch and will update the original file with the patch
# ./patch_stl.sh <originalFile> <patchFile>
# remember to chmod +x
# Takes two parameters, the original STL file and a patch and will update the original file with the patch
# xxd $1 > $1.hex && patch $1.hex < $2 && xxd -r $1.hex > $1
# rm $1.hex
cp $1 $1.backup
xxd -r $2 $1
@datapaganism
datapaganism / create_stl_patch.sh
Last active August 15, 2022 14:21
Takes two paramaters, the original STL and the modified STL to create a patch using their differences
# ./create_stl_patch <originalFile> <updatedFile>
# remember to chmod +x
# Takes two paramaters, the original STL and the modified STL to create a patch using their differences
# diff -u <(xxd $1) <(xxd $2) > $1.patch
comm -13 <(xxd $1) <(xxd $2) > $1.patch