Add support for additional 3D model formats#566
Open
chippytech wants to merge 1 commit intop2r3:masterfrom
Open
Add support for additional 3D model formats#566chippytech wants to merge 1 commit intop2r3:masterfrom
chippytech wants to merge 1 commit intop2r3:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request expands the supported 3D model input formats for the browser-based three.js visualization pipeline (threejsHandler). In addition to existing support (GLB, GLTF, OBJ, STL, PLY, FBX, DAE), the following new formats are now recognized:
3DS (.3ds) — Autodesk 3D Studio Meshes
VRML (.wrl) — Virtual Reality Modeling Language
three.js JSON Object (.json) — Native three.js scene files
Details & Highlights
New Imports:
Added TDSLoader for 3DS, VRMLLoader for VRML, and uses native ObjectLoader for three.js JSON.
supportedFormats Extended:
Each new format is listed with name, extension, MIME type, and category.
Loader Integration:
The doConvert method handles each new file type, constructing three.js objects as needed for rendering snapshots.
Housekeeping:
Blob URLs are properly revoked after use, helping browser memory.
Demonstrates Future Patterns:
The extension pattern makes additional 3D import formats easy to add in the future.
Motivation
Broader Compatibility:
Users often encounter 3D assets in legacy formats (3DS, VRML) or three.js-specific JSON scenes. Supporting these enhances the flexibility and usability of convert.to.it, making it a more comprehensive tool for 3D model preview and conversion workflows.
Uniform Interface:
All newly supported formats work identically to existing ones—upload any supported model and convert/render to PNG/JPEG/WEBP via three.js rendering.
Testing
Verified loading and 2D rendering for each new model format using varied sample files.
Checked output image formats across the entire supported range.
Notes
If further formats are needed in future (such as AMF, X3D, etc.), the loader pattern and supportedFormats array make them trivial to add.
Export (i.e., "to" model formats) is still not enabled—this only adds new input/preview types.