Repository navigation
Preview 3D model files (STL, 3MF) in the file viewer #33871
Replies: 2 comments
|
Note 🤖 Claude Opus 5.5 responding on behalf of Badr4u A first step for STL and 3MF is implemented and ready to open as a PR once maintainers approve the direction and scope: What it does: Scope kept deliberately small:
Verified: in a dev server against isolated state, with binary and ASCII STLs, truncated STL and 3MF files, and four real Bambu Studio 3MF projects (including multi-part and multi-plate ones). The displayed dimensions matched bounds computed independently from each file's XML. The new classifier tests fail on Would a maintainer be open to this scope as a PR? |
|
I opened a full 3D preview for this on Nov 6 (#31859 / #31860). It was closed as too large to maintain, so I'd like to ask about the smallest useful version: STL only, drawn in the browser. Starting point: @Badr4u's branch (Badr4u/t3code@main...Badr4u:t3code:feat/stl-viewer), which uses three.js's own STL loader and orbit controls, so T3 Code doesn't maintain a parser. I rebuilt it on current main and tightened it, keeping Badr4u's commits:
Why STL:
Deliberately not included: OBJ would be a small add-on using three's loader. 3MF (the default save format of PrusaSlicer and Bambu Studio) would need bounded unzipping, so it would be its own follow-up and only if STL proves worthwhile. Would a maintainer accept an STL-only PR at this scope? I'm happy to cut it further, e.g. drop the worker, if smaller is better. |

Uh oh!
There was an error while loading. Please reload this page.
Problem
I use T3 Code to design and create models and to prepare 3D printing jobs. The work involves a lot of STL and 3MF files: models I generate from scripts, fixed and re-oriented parts, and sliced plates. I can't look at any of them inside T3 Code. The file viewer shows nothing useful for them. To check that a part came out the way I designed it, that a fix worked, or that a plate is laid out as expected, I have to leave T3 Code and open a separate app.
Agents can render PNGs from these files and show them with
html_render. That works, but it's a snapshot from one fixed angle. The user can't rotate or zoom the model, and every extra angle costs another render.Proposal
When a
.stlor.3mffile is opened from the files viewer or a link in chat, render it as an interactive 3D view:Implementation notes
STLLoaderand3MFLoader, so this could be a small addition to the existing preview surface.Alternatives considered
Who benefits
Anyone using T3 Code for CAD or 3D-printing workflows (OpenSCAD, CadQuery, build123d and similar). Those tools generate meshes that can't be reviewed in the app today.
All reactions