From 7d915ca603b42b30e22458857ad0d462b35e37ac Mon Sep 17 00:00:00 2001 From: Dante Barbieri Date: Wed, 22 Apr 2026 12:33:52 -0500 Subject: [PATCH] fix(assimp): write real file extensions for non-extension format ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to the previous commit. With `-f` now passed to assimp, every advertised target exports successfully — but seven of them still produce files with assimp's internal format id as the extension, which no third-party viewer recognises: glb2 → .glb2 (really binary glTF 2.0, should be .glb) gltf2 → .gltf2 (text glTF 2.0, should be .gltf) objnomtl → .objnomtl (OBJ without .mtl, should be .obj) stlb → .stlb (binary STL, should be .stl) plyb → .plyb (binary PLY, should be .ply) fbxa → .fbxa (ASCII FBX, should be .fbx) assjson → .assjson (JSON dump, should be .json) Map these in `normalizeOutputFiletype`, the same helper that already handles jpeg→jpg, latex→tex, markdown→md. The format id on `convertTo` is untouched, so `assimp -f` still selects the correct encoding/variant — only the output filename changes. assbin, assxml, and pbrt are both the format id and the canonical extension, so they need no mapping. --- src/helpers/normalizeFiletype.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/helpers/normalizeFiletype.ts b/src/helpers/normalizeFiletype.ts index cf9389a..dcdce29 100644 --- a/src/helpers/normalizeFiletype.ts +++ b/src/helpers/normalizeFiletype.ts @@ -31,6 +31,24 @@ export const normalizeOutputFiletype = (filetype: string): string => { case "markdown_mmd": case "markdown": return "md"; + // assimp format ids that aren't real file extensions — map to the + // canonical extension for the underlying format so the output file + // opens in third-party viewers. The format id is still passed to + // `assimp export -f` so the right encoding/variant is produced. + case "glb2": + return "glb"; + case "gltf2": + return "gltf"; + case "objnomtl": + return "obj"; + case "stlb": + return "stl"; + case "plyb": + return "ply"; + case "fbxa": + return "fbx"; + case "assjson": + return "json"; default: return lowercaseFiletype; }