← All work
Case study · Open source · CAD

OpenCascade.js, a professional CAD kernel in the browser

OpenCascade is a mature open-source CAD kernel written in C++. OpenCascade.js is my port of it to JavaScript and WebAssembly, so web applications can model, import and analyse real CAD geometry directly in the browser.

Client
Open source (author and maintainer)
My role
Design, build system, bindings
Period
2020 - today
Stack
C++, Emscripten, WebAssembly, Python

The problem

Browser-based CAD tools need a geometry kernel: something that can build solids, run boolean operations, and read and write STEP and IGES files. OpenCascade does all of that, but it is a large C++ library. Web applications either had to run geometry on a server or reimplement it in JavaScript.

What I built

A build system that compiles OpenCascade to WebAssembly with Emscripten and generates the JavaScript bindings automatically. The bindings are generated from the C++ headers with libclangjs, libClang compiled to WebAssembly, so new OpenCascade versions do not require hand-written glue.

Because the full kernel is large, applications can define custom builds that contain only the classes and methods they need, which keeps download sizes practical. An examples repository shows typical uses.

Result

The same experience led to commercial work: I ported the ClassCAD kernel to WebAssembly for Buerli.io.

Adoption as of late September 2026:

930GitHub stars
141forks
~27,000npm downloads / week

ocjs.org