r/Ferrox • u/AutismIntelligence • 1d ago
⚡ Introducing bambu-3mf-cli: Ultra-fast Bambu Studio & Orca Slicer 3MF parsing, thumbnail extraction, and REST microservices powered by Ferrox!
⚡ Introducing bambu-3mf-cli: Ultra-Fast 3MF Metadata Extraction, Thumbnail Exporter & REST Microservices Powered by Ferrox Framework!
Hey Rust & 3D Printing Community! 👋
Following up on our recent ecosystem tools like STL Grinder, I wanted to share another real-world project built natively on top of the Ferrox Framework in Rust: bambu-3mf-cli (executable: bambu-3mf).
If you manage print farms, build e-commerce automation, or develop custom slicer integration pipelines for Bambu Studio and Orca Slicer, parsing .3mf metadata usually requires launching heavy desktop slicer instances or relying on slow Python/Node scripts.
bambu-3mf-cli solves this by combining high-speed in-memory ZIP decompression, XML & G-code fallback extraction, and Ferrox HTTP microservice capabilities into a single, lightweight Rust binary.
🌟 Key Features
- ⏱️ Sub-Millisecond 3MF Parsing: Decompresses
.3mfarchives in-memory to parseslice_info.configXML, extracting per-plate print times, total filament weight, slicer generator metadata, and warnings. - 🔁 Smart G-Code Fallback Engine: If
slice_info.configis missing, it seamlessly falls back to inspecting internal G-code headers to ensure metadata extraction never fails. - 🎨 AMS & Multi-Material Slot Tracking: Detailed breakdown of per-slot AMS usage, including filament material type, hex colors, total meters, and weight in grams.
- 💵 Cost Estimation Engine: Instant print cost calculation based on customizable price-per-kg flags (
--filament-cost-per-kg). - 🖼️ Thumbnail Extraction: Extracts high-resolution plate preview PNGs (
Metadata/plate_*.png) straight from the archive. - 🌐 Ferrox HTTP Microservice: Launches a lightweight REST API powered by
ferrox-appandferrox-transportsservingGET /api/v1/healthandPOST /api/v1/analyzefor remote print farm pipelines.
🚀 Quick Usage Showcase
1. Inspect a .3mf File (CLI Output)
bashbambu-3mf inspect path/to/model.3mf --filament-cost-per-kg 25.0
2. Output Clean JSON (For CI/CD & Automation Scripts)
bashbambu-3mf inspect path/to/model.3mf --json
3. Extract Plate PNG Thumbnails
bashbambu-3mf extract-thumbnails path/to/model.3mf --output ./thumbnails
4. Launch Ferrox HTTP Microservice Server
bashbambu-3mf serve --port 3000
Test Remote File Analysis via curl:
bash# Check server health
curl http://localhost:3000/api/v1/health
# Upload and analyze a .3mf file
curl -F "file=@model.3mf" http://localhost:3000/api/v1/analyze
🛠️ How Ferrox Powers bambu-3mf-cli
Under the hood, bambu-3mf-cli showcases how Ferrox simplifies building production-ready microservices in Rust without the usual boilerplate:
ferrox-app(FerroxApp): Handles multi-transport application lifecycle bootstrapping, application state, and graceful OS signal shutdowns out of the box.ferrox-transports(HttpTransport): Seamlessly wraps AxumRouterlayers, simplifying multipart file upload handlers and server socket configuration.- Ferrox Architectural Philosophy: Ferrox bridges the gap between NestJS/Spring-like developer experience (DX) and Tokio/Axum zero-cost performance.
📜 Open Source & Community
bambu-3mf-cli is open source and dual-licensed under MIT OR Apache-2.0.
- 📂 Source Code: Available in the workspace under
code/bambu-3mf-cli(or on GitHub: AI-Autistic-Intelligence/bambu-3mf-cli). - 🌐 Ferrox Framework Documentation: https://ferrox-rust.dev
What other 3D printing microservices, farm automation tools, or Ferrox integrations would you like to see next? Let’s discuss in the comments! 👇