// devlog
Log
CAD viewer Building a browser STEP/IGES/BREP viewer on OCCT WASM and WebGPU — shipped milestone by milestone.
-
#1 We're building a CAD viewer for the browser
First entry in the DKOPA devlog: a fast STEP viewer running entirely client-side on WASM, headed for WebGPU.
-
#2 First triangle: STEP in, pixels out
The viewer scaffold is live at /viewer — drop a .step file and it parses entirely in your browser. Here's how the pipeline works.
-
#3 Parts panel, edge lines, and the CAD look
Second milestone: the viewer now shows the part structure from your STEP file and renders teal edge outlines. Also — IGES and BREP support snuck in.
-
#4 Cutting the model open: the section plane
Third milestone: a clipping plane that sweeps through the model on any axis. Almost free in Three.js — here's how it works and what it doesn't do yet.
-
#5 Face picking: mesh in the front, B-rep in the back
Fourth milestone: click any face in the viewer and the actual B-rep face highlights — not the triangle you hit. Here's the data path that makes it work.
-
#6 Measurements: two clicks, one distance
Fifth milestone: the viewer measures point-to-point distances — two clicks on the model, a line between them, and a live label that follows you around the scene.
-
#7 True B-rep edges — from topology, not heuristics
Sixth milestone: edge lines now come from the B-rep's own face structure — every edge shown is a real CAD edge, and the extraction is one observation plus a hash map.
-
#8 WebGPU, finally — and the honest tradeoffs
Seventh milestone: the viewer now renders on WebGPU where available, falling back to WebGL2 automatically. The swap was three lines — here's why it took seven posts to get here.
-
#9 Section caps: closing the cut
Eighth milestone: clipped models now show solid faces where the section plane cuts through, instead of a hollow shell. It was the honest hard problem on the list — here's the mesh-level version.
-
#10 Measuring edges, not pixels
Ninth milestone: click an edge in the viewer and get its length — the whole B-rep edge chain, not the segment under your cursor. The interesting part is splitting the wireframe graph at junctions.
-
#11 STL and OBJ: the mesh-mode tradeoffs
Tenth milestone: the viewer takes .stl and .obj files. Easy to load — the interesting part is honestly degrading the features that need B-rep data the formats don't carry.