Geometry at the speed of light.

Crater is a Rust library for exact-predicate Booleans and 44 groups of mesh operations, from slicing to edge-graph geodesics. Choose CPU or GPU → CPU, with resident GPU outputs for supported operations. For 20 of the 35 operations measured here, every available mode returns the same complete answer, bit for bit.

Read the docs
Segmenting 2,651,904 triangles*, and how far light travels meanwhile
CPU1,050 ms315,000 km
GPU → CPU3.32 ms301 fps995 km
GPU1.07 ms930 fps322 km
    Move over the moon to carve, click to leave a crater, hold to grow and reshape: every update is a real mesh Boolean. Right-drag or two fingers turn it.

Choose where the answer lives.

Take an exact mesh Boolean: a Difference of the Giant mesh (2,682,304 triangles) and a fixed cutter. Crater gives it three entry points, each best for a different place to keep the result, and every mode returns the same mesh, bit for bit. Other operations offer the modes and output scopes described in their docs; pick per call, not per project.

  1. CPU

    Computed on the CPU and returned in host memory. No device, no upload: best for small meshes and tools without a GPU, and the reference every GPU path is tested against. At 31,360 triangles it is the fastest of the three: 2.71 ms.

    14.9 ms66.9 fps 4.1× faster than Trueform light travels 4,480 km

    engine.boolean(&body, &tool, request)
  2. GPU → CPU

    The GPU finds where the meshes touch and the exact result lands in host memory on every call. Best when CPU code needs the mesh next: export, physics, the next operation.

    15.7 ms63.7 fps 3.9× faster than Trueform, mesh in host memory light travels 4,700 km

    gpu.boolean(&body, &tool, request).await
  3. GPU

    The result stays in render-ready GPU buffers: nothing comes back over the bus. Best for live previews, like the moon above: draw it every frame while the cutter moves, and download it when the user lets go. The fastest mode from Huge up.

    9.15 ms109 fps 6.8× faster than Trueform, mesh ready to draw light travels 2,740 km

    gpu.prepare_surface_preview(&body, &tool, request).await

In the 9.15 ms of that GPU Boolean, light travels 2,740 kilometres. Trueform takes 61.8 ms for the same Difference: Crater leads it 6.8× in GPU mode, 3.9× in GPU → CPU and 4.1× on the CPU.

Plates.

Every model on this page was computed by Crater: the Boolean craters, the remeshing and smoothing, the occlusion baked from its ray queries. The black lines are the output of the operation named in each caption.

  1. Plate 1. A surface Boolean chain: (cube ∩ sphere) − three cylinders, with its 30° crease edges.
  2. Plate 2. 56 parallel plane slices, 36,574 contour segments.
  3. Plate 3. Edge-graph geodesic distance from 4 sources, one isoline per 1/34 of the longest path, on 139,516 triangles.
  4. Plate 4. Segmentation at a 35° dihedral limit: 193 regions, boundaries in ink.
  5. Plate 5. A gyroid shell clipped to a ball, extracted as a level set on a 168³ grid (2,025,960 triangles), then simplified to 150,000.
  6. Plate 6. Isotropic remesh at a target edge of 0.055: 130,306 triangles.
  7. Plate 7. The convex Minkowski sum of a tetrahedron and 420 points on a sphere: 500 hull vertices.
  8. Plate 8. Signed distance on a 256x256 plane through the part: the surface in ink, one contour per band.

Against Trueform and MeshLib.

Median milliseconds on 2,651,904 triangles, the largest fixture of Crater’s benchmark suite. Lower is faster. Competitors run on the CPU and return host results, so the fair comparison is Crater’s GPU → CPU column. GPU measures the resident output described by each row; preparation-only timings are labeled separately from complete results.

Fast at every size.

One API, three modes, each best at something. Small meshes finish in microseconds on the CPU. Large meshes fly on the GPU. You choose per call, and the docs give the recommended mode for every operation and size.

Some GPU entry points make the choice for you: Minkowski sums under 65,536 pairs and slices with fewer than 1,024 crossing triangles run the CPU path automatically, with the same result.

  • A few thousand trianglesCPUAnswers in microseconds, no device needed.
  • Tens of thousands and up, result for CPU codeGPU → CPUExport, physics, the next operation.
  • An operation with drawable resident outputGPUPreviews, editors, interactive tools.

One API, native and in the browser.

Crater is built on wgpu: Vulkan, Metal and Direct3D 12 natively, WebGPU and WebAssembly in the browser. GPU paths are checked against WebGPU’s default limits, so what runs on a workstation runs in a tab.

  • Same answer, any available mode. For 20 of the 35 operations here, complete GPU results match the CPU bit for bit: same vertices, same order, same errors (the Boolean preview up to vertex order). Other rows state their tolerance or preparation scope in the docs.
  • Explicit. Nothing crosses the bus unless you ask: download, emit and *_download are the only ways back.
  • Prepared. Upload and topology are prepared once per mesh; calls after that are one submission.
// The same segmentation, three ways.
let signals = FaceSegmentationSignals::default();
let options = SegmentationOptions::default(); // 35° dihedral

// CPU
let report = segment_mesh(&mesh, signals, options)?;

// Prepare once per mesh
let device = GpuMeshDevice::request().await?;
let asset = device.prepare_mesh(&mesh)?;
let mut seg = device.prepare_segmentation(&asset)?;

// GPU → CPU: the partition in host memory
let partition = seg
    .segment_download(&asset, signals, &[], options).await?;

// GPU: regions stay on the device
let mut resident = seg.segment_resident(&asset, signals, options)?;
let regions = resident.wait_retain().await?;
draw(resident.regions_buffer());

Measure it on your meshes.

The docs cover each operation in depth, with every number traced to its benchmark file.