1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #175] [MERGED] Add STL thumbnail generation support to File Manager #943

Closed
opened 2026-05-07 00:15:06 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/175
Author: @MisterBeardy
Created: 1/29/2026
Status: Merged
Merged: 1/29/2026
Merged by: @maziggy

Base: mainHead: feature/stl-thumbnail


📝 Commits (2)

  • 375d523 Add STL thumbnail generation support
  • 4912e8a Retrigger CI pipeline

📊 Changes

9 files changed (+1020 additions, -2 deletions)

View changed files

📝 .gitignore (+1 -1)
📝 backend/app/api/routes/library.py (+220 -0)
📝 backend/app/schemas/library.py (+29 -0)
backend/app/services/stl_thumbnail.py (+227 -0)
📝 backend/tests/integration/test_library_api.py (+123 -0)
backend/tests/unit/services/test_stl_thumbnail.py (+326 -0)
📝 frontend/src/api/client.ts (+30 -0)
📝 frontend/src/pages/FileManagerPage.tsx (+60 -1)
📝 requirements.txt (+4 -0)

📄 Description

  • Add trimesh and matplotlib dependencies for software-based 3D rendering
  • Create stl_thumbnail service with generate_stl_thumbnail() function
  • Handle mesh simplification for large files (>100k vertices)
  • Auto-generate thumbnails during STL file upload and ZIP extraction
  • Add POST /library/files/{id}/regenerate-thumbnail endpoint
  • Add POST /library/generate-stl-thumbnails batch endpoint
  • Add "Generate Thumbnails" button to file manager toolbar
  • Add "Regenerate Thumbnail" option to file context menu
  • Add unit and integration tests for new functionality

Description

Added auto generation of thumbnails on STL file uploads also those in ZIP files.
Added button to generate thumbnails for pre existing STL files.

Fixes #156

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • Added thumbnail auto generation on either upload or pre existing files

Screenshots

Screenshot 2026-01-29 at 8 57 31 AM Screenshot 2026-01-29 at 8 57 42 AM Screenshot 2026-01-29 at 9 01 25 AM

Testing

Uploaded STL files before making any changes and saw no thumbnails
Added changes and re uploaded STL files and several ZIP files with STL and 3MF files.
System autogenerated thumbnails for STL as 3MF was already there
Used ... to manually generate for several STL files
Used the Generate Thumbnails for existing STL files and verified those were created

  • I have tested this on my local machine
  • I have tested with my printer model:

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/175 **Author:** [@MisterBeardy](https://github.com/MisterBeardy) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 1/29/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `main` ← **Head:** `feature/stl-thumbnail` --- ### 📝 Commits (2) - [`375d523`](https://github.com/maziggy/bambuddy/commit/375d5238d05309ced8b931e26c2f3699d52071ca) Add STL thumbnail generation support - [`4912e8a`](https://github.com/maziggy/bambuddy/commit/4912e8ae3a68c7cf5585104dac59ba770ff6c275) Retrigger CI pipeline ### 📊 Changes **9 files changed** (+1020 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -1) 📝 `backend/app/api/routes/library.py` (+220 -0) 📝 `backend/app/schemas/library.py` (+29 -0) ➕ `backend/app/services/stl_thumbnail.py` (+227 -0) 📝 `backend/tests/integration/test_library_api.py` (+123 -0) ➕ `backend/tests/unit/services/test_stl_thumbnail.py` (+326 -0) 📝 `frontend/src/api/client.ts` (+30 -0) 📝 `frontend/src/pages/FileManagerPage.tsx` (+60 -1) 📝 `requirements.txt` (+4 -0) </details> ### 📄 Description - Add trimesh and matplotlib dependencies for software-based 3D rendering - Create stl_thumbnail service with generate_stl_thumbnail() function - Handle mesh simplification for large files (>100k vertices) - Auto-generate thumbnails during STL file upload and ZIP extraction - Add POST /library/files/{id}/regenerate-thumbnail endpoint - Add POST /library/generate-stl-thumbnails batch endpoint - Add "Generate Thumbnails" button to file manager toolbar - Add "Regenerate Thumbnail" option to file context menu - Add unit and integration tests for new functionality ## Description Added auto generation of thumbnails on STL file uploads also those in ZIP files. Added button to generate thumbnails for pre existing STL files. ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> Fixes #156 ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] Bug fix (non-breaking change that fixes an issue) - [X] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Changes Made - Added thumbnail auto generation on either upload or pre existing files ## Screenshots <img width="1201" height="906" alt="Screenshot 2026-01-29 at 8 57 31 AM" src="https://github.com/user-attachments/assets/969169f1-a182-482c-9227-11d88d80b021" /> <img width="166" height="213" alt="Screenshot 2026-01-29 at 8 57 42 AM" src="https://github.com/user-attachments/assets/cf455697-8f2c-42ac-ac49-703dd6726934" /> <img width="418" height="46" alt="Screenshot 2026-01-29 at 9 01 25 AM" src="https://github.com/user-attachments/assets/3cf242c0-ea84-4fb5-b659-8cd07549ce5f" /> ## Testing Uploaded STL files before making any changes and saw no thumbnails Added changes and re uploaded STL files and several ZIP files with STL and 3MF files. System autogenerated thumbnails for STL as 3MF was already there Used ... to manually generate for several STL files Used the Generate Thumbnails for existing STL files and verified those were created - [X] I have tested this on my local machine - [ ] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> ## Checklist - [X] My code follows the project's coding style - [ ] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [X] My changes generate no new warnings - [X] I have tested my changes thoroughly ## Additional Notes <!-- Add any additional information that reviewers should know --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:15:06 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#943
No description provided.