Meshdiff: Client-Side 3D Mesh Comparison for STL, 3MF, and OBJ Files
Meshdiff enables visual 3D mesh diffing in the browser
Meshdiff is a client-side utility designed to visually compare two versions of a 3D model. It allows users to upload two files in STL, 3MF, or OBJ formats and generates a voxel-based difference map where added material is highlighted in green and removed material is highlighted in red. The tool provides volume delta metrics and an adjustable tolerance range between 0.05mm and 1mm to refine the comparison.
Technical Architecture and Implementation
Meshdiff is built with a focus on privacy and performance by executing all computations locally in the user's browser.
Client-Side Processing
To ensure data privacy and prevent server-side uploads, Meshdiff utilizes a Web Worker to handle the heavy lifting of the diffing process. The technology stack consists of:
- React and TypeScript: Used for the application framework and type safety.
- React Three Fiber: Used for 3D rendering in the browser.
- Custom Voxel Diff Engine: A proprietary engine developed to handle "triangle soup"—the common, non-manifold geometry found in real-world STL files.
Voxel-Based Comparison vs. CSG
Unlike tools that rely on Constructive Solid Geometry (CSG) libraries like Manifold or CGAL, which require clean, watertight topology to function correctly, Meshdiff uses a voxel-based approach. This ensures the tool remains robust when processing real-world meshes that often contain topological errors or gaps.
Community Feedback and Feature Requests
Users and community members on Hacker News have identified several potential enhancements for the tool's usability and integration:
Viewport Synchronization
Multiple users requested a "locked view" or "synchronized transform" feature. This would allow users to rotate or pan one viewport, and have the other viewports rotate in unison, making it easier to compare specific angles across different versions of a model.
Integration and Automation
Suggestions for CI/CD integration were proposed to make the tool more useful for professional workflows:
- GitHub PR Triggers: Integrating Meshdiff as a trigger on GitHub Pull Requests to automatically preview 3D file changes between branches.
- CLI Tool: Developing a Command Line Interface (CLI) to allow for the automated generation of diffs for later inspection.
Bug Reports and Edge Cases
Some users noted specific technical limitations in the current version:
- Multi-group OBJ files: It was reported that multi-group OBJ files are currently ignored, with only the first group being rendered.
- Duplicate File Warning: Users suggested adding a warning when the same file is uploaded twice to avoid confusion.
"I built Meshdiff because clients keep sending me part_v3_FINAL.stl and I have no quick way to see what changed. Drop two STL/3MF/OBJ files – voxel diff renders in your browser."
– @projscope