Tutorial: Add a thumbnail to you 3mf files  

  RSS
Peter S.
(@lichtjaeger)
Reputable Member

If you didn't know it yet, you can add a thumbnail to your 3mf files (PrusaSlicer project files).

File explorer with appropriate support will show a preview of the project instead of the file icon.

 

First, you need to prepare a preview image. A 512x512 PNG will be perfect, but any quadratic PNG or JPEG file will work. Name it "thumbnail.(png|jpeg)".

Next, unzip your 3mf file. Yes, you can unzip them. Maybe you need to replace the .3mf extension with .zip.

Inside the file, you will find a "_rels", a "3D" and "Metadata" directory and the "[Content_Types].xml" file. Put the thumbnail file inside the "Metadata" directory.

Now we need to edit two files. I use VS Code as my text editor.

At the moment the "[Content_Types].xml" will look like:

<?xml version="1.0" encoding="UTF-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="model" ContentType="application/vnd.ms-package.3dmanufacturing-3dmodel+xml"/>
</Types>

We need to add two lines:

<?xml version="1.0" encoding="UTF-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="model" ContentType="application/vnd.ms-package.3dmanufacturing-3dmodel+xml"/>
<Default Extension="png" ContentType="application/vnd.ms-package.3dmanufacturing-3dmodeltexture"/>
<Override PartName="/Metadata/thumbnail.png" ContentType="image/png"/>
</Types>

(replace the "png" with "jpeg" if you use jpeg format)

Similar thing for "_rels/.rels". It will first look like:

<?xml version="1.0" encoding="UTF-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Target="/3D/3dmodel.model" Id="rel-1" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel" />
</Relationships>

And we need to add one line:

<?xml version="1.0" encoding="UTF-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Target="/3D/3dmodel.model" Id="rel-1" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel" />
<Relationship Target="/Metadata/thumbnail.png" Id="rel999" 
Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" />
</Relationships>

(again, replace the "png" with "jpeg" if you use jpeg format)

Zip the project and make sure that the four previously mentioned elements are back in the root of the zip file. Now, you can rename the file back to .3mf. If you have a compatiple file explorer (like Windows 10) you will immediately see your thumbnail.

Posted : 05/11/2019 12:03 pm
tg73 liked
Sembazuru
(@sembazuru)
Honorable Member

I wonder if automatically adding a thumbnail could/should be added to PrusaSlicer's output options (or preferences, not sure which is better). Otherwise, once one saves from PrusaSlicer isn't all the above work is lost?

Also, please define what you mean by a "quadratic" PNG or JPEG for those of us who aren't in the know. 😉

Posted : 05/11/2019 4:48 pm
Peter S.
(@lichtjaeger)
Reputable Member
Posted by: @sembazuru

Also, please define what you mean by a "quadratic" PNG or JPEG for those of us who aren't in the know. 😉

Quadratic or square. Same height as width.

Posted : 05/11/2019 5:28 pm
Sembazuru
(@sembazuru)
Honorable Member
Posted by: @lichtjaeger
Posted by: @sembazuru

Also, please define what you mean by a "quadratic" PNG or JPEG for those of us who aren't in the know. 😉

Quadratic or square. Same height as width.

Ah, ok. I didn't know if it was that or if power of 2 or what. (Your example qualified for both. 😉) I was also wondering if it some how related to quadratic equations... Just a term usage I'm unfamiliar with.

Posted : 05/11/2019 10:09 pm
Peter S.
(@lichtjaeger)
Reputable Member
Posted by: @sembazuru

Otherwise, once one saves from PrusaSlicer isn't all the above work is lost?

True. I opened an issue about this.

At the moment this modification would only make sense just before uploading the project to a platform.

Posted : 06/11/2019 5:14 am
Share:

Please Login or Register