gitmyhub

implicit.js

JavaScript ★ 56 updated 2mo ago

A library for modelling 3D objects with mathematical primitives

A browser based library that turns small code files describing math shapes into interactive 3D models you can preview, screenshot, and export as STL, 3MF, or GLB.

JavaScriptThree.jsWebGLGLSLViteNode.jssetup: easycomplexity 3/5

implicit.js is a JavaScript library for describing and displaying 3D shapes using mathematical formulas instead of traditional 3D modeling software. The approach it uses, called implicit CAD, represents shapes as math functions rather than lists of triangles or points. This makes it well suited for parametric parts (shapes where you control dimensions through numeric values), mathematical surfaces, procedural art, and geometry produced by AI agents.

The core idea is that a 3D model in this system is just a small JavaScript file containing a math function that describes where the surface of a shape is. You can add adjustable parameters like a radius or width that a user can change through controls. The library then takes that description and renders it visually in the browser using WebGL, a standard graphics technology built into modern browsers. No special software installation is needed to view the result.

Beyond live previews, the library can export models as STL, 3MF, and GLB files, which are standard formats used by 3D printers, CAD tools, and 3D game engines. It can also generate still image snapshots and animated GIFs. A quality analysis step helps you check the generated mesh before handing it off to another tool.

The library works inside React apps, plain browser pages, local AI agent tools, and server-side export pipelines. Installation is a single npm command. A demo app is included in the repository that shows a code editor alongside a live 3D preview with parameter controls, so you can experiment with shape definitions immediately without building anything from scratch.

Documentation covers the model file format, the full API for loading and rendering shapes, a command-line interface for batch snapshot and export jobs, and notes for contributors. The license is MIT, meaning it is free to use and modify.

Where it fits