Add a script that generates a pov model from an stl but gives it the proper name (of the file). Using this to build renders of the models for launch (tomorrow?)
This commit is contained in:
parent
563b24d90e
commit
03059f7c5c
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
INPUT="$1"
|
||||||
|
OUTPUT="$2"
|
||||||
|
|
||||||
|
if [ "$INPUT" = "" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$OUTPUT" = "" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILE_NAME=`basename "${INPUT}" .stl`
|
||||||
|
TMP_FILE=`mktemp`
|
||||||
|
|
||||||
|
stl2pov "${INPUT}" > "${TMP_FILE}"
|
||||||
|
|
||||||
|
DECLARE_LINE=`cat "${TMP_FILE}" | grep "^#declare "`
|
||||||
|
MODEL_NAME=`echo "${DECLARE_LINE}" | awk '{print $2}'`
|
||||||
|
NEW_LINE=`echo $DECLARE_LINE | sed "s/${MODEL_NAME}/${FILE_NAME}/g"`
|
||||||
|
|
||||||
|
cat "${TMP_FILE}" | sed "s/$DECLARE_LINE/$NEW_LINE/" > "${OUTPUT}"
|
||||||
|
|
||||||
|
rm "${TMP_FILE}"
|
||||||
|
echo "${FILE_NAME}"
|
Loading…
Reference in New Issue