OBJViewer is a lightweight, high-performance 3D model viewer integrated directly into Visual Studio Code. It allows developers and 3D artists to preview geometry files without leaving their development environment.
🚀 Features
Multi-Format Support: Native support for viewing .obj, .ply, and .ifc (BIM) files.
Custom Editor Integration: Automatically opens supported 3D files in a custom high-fidelity Webview panel.
Spatial Structure Explorer: Dedicated IFC tree panel that displays the architectural hierarchy (Project > Site > Building > Storey).
Sidebar Navigation: A dedicated "3D Models" view in the Activity Bar to quickly browse and open assets within your workspace.
Interactive Controls:
Orbit Controls: Smoothly rotate, pan, and zoom around models.
Wireframe Toggle: Switch between solid and wireframe modes to inspect geometry.
Auto-Rotation: Hands-free inspection mode.
Multi-File Scene: Use the "+ Add File" button to overlay multiple models in a single workspace.
🛠️ Technical Architecture
The extension is built using a modern stack designed for performance within the VS Code Extension Host:
BIM Engine: web-ifc-three for parsing complex Industry Foundation Classes.
Backend: TypeScript with Webpack bundling.
Communication: Asynchronous message passing between the VS Code API and the Webview sandbox.
📖 How to Use
Opening Files
You can open 3D files by clicking them in the standard VS Code Explorer or using the 3D Models Sidebar located in the Activity Bar.
Inspecting IFC Files
When an .ifc file is opened, a Spatial Structure panel appears on the left side of the viewer. This allow you to see the exact Express ID and architectural type of every element in the model.
Toolbar Actions
+ Add File: Select another model from your computer to add it to the current 3D scene.
Reset Camera: Instantly snaps the view back to the original starting position.
Toggle Wireframe: Toggles the wireframe visibility for all loaded models in the scene.
🛠️ Development
This project uses Webpack to bundle the extension code:
npm run watch: Automatically recompiles the extension on file changes.
npm run package: Builds a production-ready .vsix package.