STL Previewer for VS Code

A powerful VS Code extension for viewing and comparing STL (Stereolithography) files with interactive 3D rendering capabilities powered by Three.js.
✨ Features
🎨 Interactive 3D Viewer
- View STL files directly in VS Code without external applications
 
- Interactive 3D rendering with smooth rotation, zoom, and pan controls
 
- Multiple camera views: Isometric, Top, Left, Right, Bottom views with quick view buttons
 
- High-quality rendering powered by Three.js
 
🔍 Visual Comparison (Diff View)
- Compare STL files from Git history
 
- Color-coded diff visualization:
- 🟢 Green: Added geometry
 
- 🔴 Red: Removed geometry
 
- 🔵 Blue: Intersecting/unchanged geometry
 
 
- Automatic CSG operations (Constructive Solid Geometry) for precise differences
 
- Semi-transparent rendering for better visibility of changes
 
- Real-time camera information: Position and rotation values
 
- Bounding box dimensions: Width, length, height
 
- Min/Max coordinates for precise measurements
 
- Live updates as you interact with the model
 
⚙️ Customizable Display Options
- Grid: Toggle floor grid with customizable color
 
- Axes Helper: Show X, Y, Z axes for orientation
 
- Bounding Box: Display object boundaries
 
- View Controls: Enable/disable quick view buttons
 
- Material Types: Choose from Basic, Standard, Lambert, Normal, or Phong materials
 
- Custom material configuration for advanced users
 
📦 Installation
Quick Install:
- Press 
Ctrl+P in VS Code 
- Type: 
ext install misiekhardcore.stl-previewer 
- Press Enter
 
For alternative installation methods, see the Quick Start Guide.
🚀 Usage
For detailed usage instructions, see the Usage Guide.
Quick Start:
- Open any 
.stl file in VS Code 
- Use mouse controls to navigate (left-click drag to rotate, right-click drag to pan, scroll to zoom)
 
- Use view buttons for preset camera positions
 
- View Git diffs through Source Control panel
 
📚 Documentation
⚙️ Configuration
Access settings via File > Preferences > Settings and search for "STL Previewer".
For comprehensive configuration options and examples, see the Configuration Guide.
🛠️ Technical Details
- STL (ASCII and Binary formats)
 
Dependencies
- Three.js (v0.178.0): 3D rendering engine
 
- three-bvh-csg (v0.0.17): Constructive Solid Geometry operations for diff view
 
Requirements
- VS Code version 1.52.0 or higher
 
- Git extension (for diff functionality)
 
📋 Known Limitations
- Large STL files may take longer to load
 
- Diff view requires Git version control
 
- CSG operations for complex models may be computationally intensive
 
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
 
- Create your feature branch (
git checkout -b feature/AmazingFeature) 
- Commit your changes (
git commit -m 'Add some AmazingFeature') 
- Push to the branch (
git push origin feature/AmazingFeature) 
- Open a Pull Request
 
🐛 Reporting Issues
If you encounter any issues or have suggestions:
- Check existing issues
 
- Create a new issue with:
- Clear description of the problem
 
- Steps to reproduce
 
- Expected vs actual behavior
 
- VS Code version and OS information
 
 
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Links
📚 External Resources
Three.js
VS Code
🙏 Acknowledgments
Enjoy previewing your STL files! ⭐ Star this repo if you find it useful!