Architecture
ClassCAD has three layers.
- Runtime. A C++ program. It compiles and runs ClassCAD's own language, holds the model in memory and answers API calls. It is built for Windows, Linux and WebAssembly.
- Classes. The CAD logic is written in the ClassCAD language, one class per file, and compiled to bytecode for the runtime's virtual machine. The system classes (Common, BaseModeling, CAD, System) ship with the runtime and define the API.
- Plugins. C++ libraries the runtime loads when it starts: the geometry kernel (SMLib), the 2D and 3D constraint solvers, and the file formats (STEP, DXF, glTF and others).
The API, api.v1.<domain>.<method>, is generated from the system classes with every release: as typed packages for TypeScript, Python and .NET, and as the reference on this site.
A client sends API calls; the runtime runs them one after another and returns the results and the geometry. In the browser, the client is your page and the runtime runs in its Web Worker. Natively, the client is your program, and the ClassCAD server on your machine starts a runtime process for each session.