Skip to content

Conversation

@trek-e
Copy link

@trek-e trek-e commented Jan 24, 2026

Summary

  • Adds support for importing Wavefront OBJ (.obj) files alongside existing STL support
  • Creates unified MeshImporter that automatically detects file type by extension
  • OBJ parser handles vertex positions, normals, and various face formats

Changes

  • New files:
    • Assets/Scripts/Util/Mesh/ObjParser.cs - Parses OBJ file format
    • Assets/Scripts/Util/Mesh/MeshImporter.cs - Unified importer for STL/OBJ
  • Modified files:
    • Constants.cs - Added SupportedFilePatterns array for multiple formats
    • IFileSystem.cs / FolderFileSystem.cs - Support multiple file patterns
    • ImportFolder.cs - Use new patterns array
    • Library.cs / ViewPort.cs - Use new MeshImporter

OBJ Parser Features

  • Vertex positions (v x y z)
  • Vertex normals (vn x y z)
  • Face definitions: f v, f v/vt, f v/vt/vn, f v//vn
  • Polygon triangulation (fan triangulation for quads and n-gons)
  • Coordinate system conversion (OBJ right-handed → Unity left-handed)

Test plan

  • Import folder containing only STL files (existing functionality)
  • Import folder containing only OBJ files (new functionality)
  • Import folder containing mixed STL and OBJ files
  • Verify OBJ models display correctly with proper orientation
  • Verify OBJ models can be rotated and tagged like STL files

🤖 Generated with Claude Code

trek-e and others added 2 commits January 23, 2026 18:39
- STACK.md - Technologies and dependencies
- ARCHITECTURE.md - System design and patterns
- STRUCTURE.md - Directory layout
- CONVENTIONS.md - Code style and patterns
- TESTING.md - Test structure
- INTEGRATIONS.md - External services
- CONCERNS.md - Technical debt and issues
- Add ObjParser for parsing Wavefront OBJ files
- Create unified MeshImporter that handles STL and OBJ formats
- Update Constants to support multiple file patterns (*.stl, *.obj)
- Update IFileSystem/FolderFileSystem to support multiple patterns
- Update Library and ViewPort to use new MeshImporter

OBJ parser supports:
- Vertex positions (v)
- Vertex normals (vn)
- Face definitions with various formats (f v, f v/vt, f v/vt/vn, f v//vn)
- Polygon triangulation (fan triangulation for n-gons)
- Coordinate system conversion (right-handed to Unity's left-handed)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@trek-e trek-e mentioned this pull request Jan 24, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant