diff --git a/support/openscad-thumbnailer b/support/openscad-thumbnailer new file mode 100644 index 0000000..f5d3873 --- /dev/null +++ b/support/openscad-thumbnailer @@ -0,0 +1,18 @@ +#!/bin/sh + +SCHEME=${4:-Tomorrow} + +IN_FILE="$1"; +OUTFILE="$2"; +SIZE="$3"; + + + +openscad-nightly \ + --preview \ + --colorscheme=$SCHEME \ + -o "$OUTFILE".png \ + --imgsize=$SIZE,$SIZE \ + "$IN_FILE" 2> /dev/null + +mv "$OUTFILE.png" "$OUTFILE" diff --git a/support/openscad.thumbnailer b/support/openscad.thumbnailer new file mode 100644 index 0000000..6274836 --- /dev/null +++ b/support/openscad.thumbnailer @@ -0,0 +1,3 @@ +[Thumbnailer Entry] +Exec=openscad-thumbnailer %i %o %s +MimeType=application/x-openscad; diff --git a/support/stl-mime.xml b/support/stl-mime.xml new file mode 100644 index 0000000..6d7eedb --- /dev/null +++ b/support/stl-mime.xml @@ -0,0 +1,7 @@ + + + + Stereolithography 3D Model + + + diff --git a/support/stl-thumbnailer b/support/stl-thumbnailer new file mode 100644 index 0000000..19be082 --- /dev/null +++ b/support/stl-thumbnailer @@ -0,0 +1,5 @@ +#!/bin/sh +TMP_FILE=$(mktemp) +echo "import(\"$1\");" > $TMP_FILE +openscad-thumbnailer $TMP_FILE "$2" "$3" Nature +rm $TMP_FILE diff --git a/support/stl.thumbnailer b/support/stl.thumbnailer new file mode 100644 index 0000000..4db7052 --- /dev/null +++ b/support/stl.thumbnailer @@ -0,0 +1,3 @@ +[Thumbnailer Entry] +Exec=stl-thumbnailer %i %o %s +MimeType=application/sla;