The Problem
Browsers cannot natively open CAD, mesh, or BIM files like STEP, IFC, or GLTF. Teams evaluating or sharing 3D models must install desktop software, convert files, or rely on proprietary viewers. Online3DViewer removes that friction by rendering 18 import formats directly in the browser with no server-side processing.
What This Does
Online3DViewer is a JavaScript library and web application for viewing, measuring, and exporting 3D models. The source/engine/ directory contains the core library: geometry math (coord3d.js, matrix.js, octree.js), import/export handlers (importer.js, exporter.js), and a viewer built on three.js. The source/website/ directory wraps that engine in a full UI with settings, localization, and file management.
The repo also ships sandbox/ with 30+ self-contained HTML examples showing embedding patterns, and docs/ with generated API reference pages. It is a fork of the actively maintained kovacsv/Online3DViewer (3,663 stars), so the codebase is mature despite this fork's zero stars.
How It Is Wired
Execution starts in source/engine/main.js, which has 31 modules importing it and 77 imports of its own (instability 0.71). It routes through source/engine/import/importer.js for file parsing and source/engine/export/exporter.js for serialization. The geometry layer is the stability anchor: source/engine/geometry/geometry.js has 33 dependents and imports nothing (instability 0), meaning any change there ripples widely but it never changes for upstream reasons.
The main hub is source/engine/main.js — it orchestrates the viewer lifecycle, format registry, and task queue. source/engine/core/localization.js (28 dependents) and source/engine/geometry/coord3d.js (28 dependents) are secondary hubs. Two modules (source/website/utils.js, source/website/settings.js) form a circular import, which complicates refactoring those files.
A run's flow: browser loads website/index.html → source/website/index.js initializes → source/engine/main.js creates a viewer → user drops a file → importer.js dispatches to a format-specific parser → geometry is stored in geometry.js structures → viewer/ renders via three.js. No network calls or database writes occur; all processing is client-side.
How To Use It
Setup (from package.json and package-lock.json):
npm install
npm run build
Running: Open website/index.html in a browser, or serve the directory with any static file server. The npm package online-3d-viewer exposes the library for embedding. No environment variables or configuration files are required.
Embedding: Use the sandbox/embed_iframe.html pattern — initialize with Init3DViewerFromFileList() or Init3DViewerFromUrlList() from source/engine/main.js.
Real-World Use
A procurement team evaluating STEP files from multiple CAD vendors: they drop files into the viewer, use the measurement tools (source/engine/viewer/measure.js) to verify dimensions, and export to GLTF for downstream web AR. The sandbox examples show how to embed this in an internal tool with a custom file host (sandbox/embed_filehost.html).
Code Health & Issues
Static analysis (58 findings: 17 high, 40 medium, 1 low) reports:
- High – Import cycle in
source/website/utils.jsandsource/website/settings.js - High – Deep nesting (max depth 7) in
utils.js,importer.js,exporter3dm.js - High – Hub modules:
geometry.js(33 dependents),main.js(31),localization.js(28) - High – 74 duplicated 6-line blocks across 23 import/export files
- Medium – Oversized files:
importer3ds.js,importergltf.js,website.js(601+ lines) - Medium – File handle leak in
tools/lib/utils.py(no context manager)
SDLC audit adds: CI workflows use unpinned action tags (ncipollo/release-action@v1), no test command in CI despite 245 test files, no Dependabot, npm install instead of npm ci, no dependency scan, and two binaries over 5MB (X_Bot.dae 6.8MB, DamagedHelmet.gltf 4.8MB). No secrets committed, license and lockfile present.
The Bottom Line
This is a production-grade 3D viewer with broad format support and a clean engine/UI split. The fork has no unique additions over upstream yet, so teams should evaluate the original kovacsv/Online3DViewer unless they need this specific fork. The code quality issues are typical for a mature codebase — manageable, but CI needs hardening before trusting its green check.