How it works
You hand it a 2D polygon — a handful of points, or an SVG path — and it gives back a solid 3D shape ready to drop into any Three.js scene.
Under the hood it runs a constrained Delaunay triangulation on the polygon's interior, using a WebAssembly port of the Triangle library. That gives you a clean mesh of non-overlapping triangles that respects the boundary exactly, with no gaps or slivers. The cap is then mirrored and the two faces are connected by side walls to form the final extruded volume.
The scene above is a live example — a flat rectangle tessellated by the library, with each triangle painted independently.
Where you'd use it
- Turning SVG logos or icons into 3D objects for product configurators or hero scenes
- Rendering extruded text in WebGL without relying on font-specific geometry builders
- Procedural terrain patches or architectural floor plans that need actual depth
- Any situation where you have a 2D outline and need a solid, well-triangulated mesh