Added thumbnailers for stl & openscad
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
1b3fb64ca8
commit
193335d173
5 changed files with 36 additions and 0 deletions
18
support/openscad-thumbnailer
Normal file
18
support/openscad-thumbnailer
Normal file
|
|
@ -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"
|
||||
3
support/openscad.thumbnailer
Normal file
3
support/openscad.thumbnailer
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[Thumbnailer Entry]
|
||||
Exec=openscad-thumbnailer %i %o %s
|
||||
MimeType=application/x-openscad;
|
||||
7
support/stl-mime.xml
Normal file
7
support/stl-mime.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/sla">
|
||||
<comment>Stereolithography 3D Model</comment>
|
||||
<glob pattern="*.stl"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
5
support/stl-thumbnailer
Normal file
5
support/stl-thumbnailer
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
TMP_FILE=$(mktemp)
|
||||
echo "import(\"$1\");" > $TMP_FILE
|
||||
openscad-thumbnailer $TMP_FILE "$2" "$3" Nature
|
||||
rm $TMP_FILE
|
||||
3
support/stl.thumbnailer
Normal file
3
support/stl.thumbnailer
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[Thumbnailer Entry]
|
||||
Exec=stl-thumbnailer %i %o %s
|
||||
MimeType=application/sla;
|
||||
Loading…
Add table
Add a link
Reference in a new issue