OFF Viewer
A lightweight VS Code extension for inspecting Object File Format (.off) 3D mesh files directly in the editor.
This is designed for opening small to midsize OFF files for quick inspection, useful when working with computational geometry problems and point clouds.
Quickstart
- Install the extension from the VS Code Marketplace.
- Open any
.off file in VS Code.
- The 3D preview opens automatically.
- Use your mouse to navigate the scene:
- Left-drag — rotate
- Right-drag — pan
- Scroll — zoom
- To open the raw off file, click the <> page icon
Features
Automatic preview — .off files open in a 3D viewer by default
Mesh, edges, and vertices — all three representations are rendered and can be toggled independently with the overlay buttons
| Mesh on |
Mesh off |
 |
 |
Per-face colors — faces with RGB or RGBA color values in the file are rendered with those colors (both 0–255 integer and 0–1 float ranges are supported)
Camera controls — full orbit, pan, and zoom via OrbitControls. Use the Reset button to return to the default view.
Info panel — click Info to show vertex, face, and edge counts for the loaded mesh.
Parse error display — malformed files show a clear in-viewer error message with the offending line number.
Live reload — if you edit the .off file externally, the preview updates automatically.
Open as raw text — click the </> button in the editor title bar to open the raw .off file as text in a split view beside the preview. Also accessible via the command palette (OFF Viewer: Open as Raw Text).
Overlay Controls
| Button |
Action |
| Mesh |
Toggle shaded face rendering |
| Edges |
Toggle wireframe edges |
| Vertices |
Toggle vertex points |
| Reset |
Reset camera to default position |
| Info |
Show/hide geometry statistics |
</> (title bar) |
Open the raw .off file as text beside the viewer |
The extension parses the standard OFF format:
OFF
<numVertices> <numFaces> <numEdges>
x y z # one vertex per line
...
N v0 v1 ... vN-1 [r g b [a]] # N-gon face, optional color
...
- Comments (
#) and blank lines are ignored
- Polygonal faces (triangles, quads, N-gons) — all triangulated for rendering
- Optional per-face RGB/RGBA colors in either integer (0–255) or float (0–1) range
- Descriptive error messages with line numbers for invalid files
Requirements
No external dependencies. Three.js is bundled with the extension.
Known Issues
- Very large meshes may render slowly — this is intended as a quick inspection tool and is not a full modeling environment
linewidth > 1 is not supported on WebGL on most platforms, so edges may render at 1px width regardless of zoom level.
Release Notes
0.0.1
Initial release — parse and render .off files with mesh, edge, and vertex display, camera controls, per-face color support, and parse error reporting.