STL Export Pipeline¶
The STL pipeline converts GLB models from AI providers into print-ready STL files with automated quality assurance.
Architecture¶
GLB Model (Tripo/Meshy)
|
v
Download & Convert (trimesh)
|
v
Auto-Repair (admesh)
|
v
Quality Assessor (GPT-4o) → REJECT / FAST / FULL
|
v
Scale & Validate
|
v
Remix Decision (GPT-4o) → PASS / REMIX / ESCALATE
|
v
Upload STL to MinIO
The pipeline runs as a FastAPI microservice (mdu-stl-pipeline) on port 8090, proxied through mdu-api.
Endpoints¶
Direct (STL Pipeline)¶
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/stl/health |
- | Health check |
| GET | /api/stl/profiles |
- | List printer profiles |
| POST | /api/stl/export/stl |
- | Start STL export job |
| GET | /api/stl/export/status/:jobId |
- | Poll job status |
Proxied via mdu-api¶
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/stl-profiles |
- | List printer profiles |
| POST | /api/stl-export |
Required | Start STL export job |
| GET | /api/stl-status/:jobId |
Required | Poll job status |
Printer Profiles¶
5 built-in profiles optimized for different printer types:
| Profile | Type | Layer Height | Nozzle |
|---|---|---|---|
fdm_standard |
FDM | 0.2mm | 0.4mm |
fdm_fine |
FDM | 0.1mm | 0.4mm |
resin_standard |
Resin | 0.05mm | - |
resin_fine |
Resin | 0.025mm | - |
resin_ultra |
Resin | 0.01mm | - |
Export STL¶
POST /api/stl-export
Authorization: Bearer <token>
Content-Type: application/json
{
"source": "tripo",
"tripo_task_id": "abc123",
"printer_profile": "fdm_standard",
"target_scale": "32mm_standard",
"auto_repair": true,
"original_prompt": "dwarf warrior"
}
Response (immediate):
Source Options¶
| Source | Required Field | Description |
|---|---|---|
tripo |
tripo_task_id |
Tripo3D task |
meshy |
meshy_task_id + meshy_task_type |
Meshy task |
meshy_task_type: text-to-3d or image-to-3d
Poll Status¶
Response (success):
{
"job_id": "abc12345",
"status": "success",
"progress": 100,
"stage": "done",
"stl_url": "https://minidreamuniverse.com/api/assets/mdu-assets/...",
"metadata": {
"face_count": 42800,
"is_watertight": true,
"volume_mm3": 12450.5,
"bounding_box_mm": [24.5, 31.2, 38.7],
"quality_status": "PASS"
},
"qa_path": "FAST",
"qa_score": 92,
"remix_decision": { "action": "PASS", "confidence": 0.95 }
}
Stages: downloading → converting → repairing → validating → scaling → uploading → done
AI Quality Assurance¶
Flow 2 — Quality Assessor¶
After mesh repair, GPT-4o evaluates the mesh and routes it:
| Decision | Action |
|---|---|
| FAST | Skip detailed validation, proceed directly |
| FULL | Run complete validation suite |
| REJECT | Fail the job immediately |
Flow 3 — Remix Decision¶
After validation, GPT-4o evaluates the final result:
| Decision | Action |
|---|---|
| PASS | Model is print-ready |
| REMIX | Badge stored in metadata (suggest re-generation) |
| ESCALATE | Flag for manual review |
Base Generation¶
POST /api/generate-base
Authorization: Bearer <token>
{
"miniature_bbox": [24.5, 31.2, 38.7],
"style": "gaming",
"base_type": "round",
"base_size": "32mm",
"magnet_slots": true,
"printer_profile": "fdm_standard"
}
Uses Flow 4 (Base Customizer) to generate build123d Python code, executes it in the mdu-base-builder container, and returns a MinIO-hosted STL URL.
Usage Limits¶
STL export counts are enforced per subscription plan:
| Plan | STL Exports/month |
|---|---|
| Free | 10 |
| Starter | 30 |
| Pro | 50 |
Performance¶
- Tripo3D pipeline: ~12 seconds end-to-end
- Meshy pipeline: ~154 seconds (uses Remesh), GLB fallback available
- Validation timeout: 240 seconds