Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
3D model preview
model-viewer.js is Vole’s viewer: it draws a blob into a canvas with
drag-to-turn (a turntable: sideways spins the model about its own up axis, up
and down tips it over the top, and the two mix without rolling it), wheel,
pinch or button zoom, a six-face orientation cube for snap views, a wireframe
toggle, and a Sync button that turns and zooms the two viewers of a diff
together.
app.js imports it only when a page contains a [data-model] element, so no
other page downloads it.
three.bundle.js is a generated ES module containing three.js and the loaders
the viewer uses. It is committed so an instance is still one binary and there is
no npm step in the build:
- three.js r187,
three.module.jsand theOrbitControls,STLLoader,OBJLoader,GLTFLoaderandThreeMFLoaderexample modules. MIT License. Seethree.LICENSE. - fflate 0.8.3, which the 3MF loader uses to unzip the package.
MIT License. See
fflate.LICENSE.
Regenerate the bundle after bumping THREE_VERSION in the script:
python3 scripts/vendor-three.py # write three.bundle.js and three.LICENSE
python3 scripts/vendor-three.py --check # compare, exit 1 if they differ
Node and npx are needed to regenerate the bundle, because esbuild resolves the
loaders’ bare three imports and their own dependencies into one module. Running
Vole does not need either. Bump ESBUILD_VERSION with THREE_VERSION when the
pinned esbuild no longer builds the release.
Formats
| Extension | Loader | Notes |
|---|---|---|
.stl |
STLLoader |
Binary and ASCII |
.obj |
OBJLoader |
Geometry only; a companion .mtl is not loaded |
.gltf |
GLTFLoader |
Relative buffers and textures resolve through the raw route |
.glb |
GLTFLoader |
Same, self-contained |
.3mf |
ThreeMFLoader |
Unzipped in the browser by fflate |
Compressed glTF assets are not supported: Draco, KTX2 and meshopt need their own decoders, and those would add a WASM eval or more vendored code. A model that uses them reports that it could not be loaded and keeps its download link.
The viewer creates blob URLs to decode textures embedded in a glTF or 3MF file.
That is why the page’s Content-Security-Policy allows blob: for images and
connections; see server/web/auth.go.