Skip to content
Projects

About

Render 3D models in Typst

Creative & Media

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

maquette logo

maquette

Live demo Typst Universe Build License: MIT

maquette is a set of Typst plugins for embedding 3D renders directly in your documents. Change a parameter, recompile the .typ, and the render lands in your PDF, no external tools, no manual re-exports, no separate asset pipeline.

https://github.com/user-attachments/assets/ae7657b1-dd55-4dc3-af3f-5b66d8f2b51b

Try it live → a browser demo runs the exact same WebAssembly the plugins ship. Drag to orbit, tweak every setting, copy the generated Typst source. The demo runs the wasm through a browser JIT rather than Typst's interpreter, so it iterates ~10× faster than a document rebuild.

The plugins

Package What it renders
maquette STL / OBJ / PLY
maquette-gltf glTF 2.0 (.glb / .gltf)
maquette-scad .scad

Usage

maquette
#import "@preview/maquette:0.2.1": render-obj

#render-obj(
  read("bunny.obj"),
  up: (0, 1, 0),
  azimuth: 180,
  distance: 0.25,
  lights: (
    (
      type: "positional",
      vector: (-0.1, 0.14, -0.04),
      color: "#ff0000",
      intensity: 3.0,
    ),
  ),
  sss: (
    intensity: 4,
    power: 3.5,
    distortion: 0.2,
  ),
  antialias: 3,
  background: none,
)
Subsurface-scattering Stanford bunny backlit by a red light
maquette-scad
// example.scad
$fn = 100;
module rod(d, h) cylinder(h, d = d, center = true);
hole = 25;
len = 62.5;
difference() {
  sphere(d = 50);
  rod(hole, len);
  rotate([90, 0, 0]) rod(hole, len);
}
color([0.5, 0.3, 0.1, 0.6])
rotate([0, 90, 0]) rod(hole, len);
#import "@preview/maquette-scad:0.1.0": render-scad

#render-scad(
  read("example.scad"),
  azimuth: 219,
  elevation: 33,
  up: (0, 1, 0),
  fov: 40,
  zoom: 1.2,
  background: none,
)
OpenSCAD logo compiled from source to a mesh
maquette-gltf
#import "@preview/maquette-gltf:0.1.0": render-gltf

#render-gltf(read("tokyo.glb", encoding: none), (
  camera: (-71.915, 159.083, 1026.801),
  center: (-86, 5, -25),
  up: (0, 0.989, -0.145),
  auto-center: false,
  auto-fit: false,
  background: "#182028",
  shadows: true,
  ssao: true,
  time: 5.4,
))
glTF Little Tokyo diorama rendered with PBR

Documentation

Documentation contains many examples showcasing all the features, with each example being a clickable image redirecting to its live demo version, allowing you to easily discover features.

Other projects using maquette

Beyond Typst

The same renderer also ships as a native binary and as language bindings. See each README:

Target What Get it
CLI native maquette binary → PNG/SVG cargo install --path crates/maquette-cli
Python pyo3 module (dict config → PNG/SVG bytes) pip install maquette
JavaScript the wasm, in Node + the browser npm install maquette-render
C ABI libmaquette + header — bind from C/C++/Ruby/Julia/Go/… build from source

Building

make build       
make gltf-build  
make scad-build  
make demo        
make docs        

Requires cargo, the wasm32-unknown-unknown target, and wasm-opt from binaryen.

Explore related projects

Loading…