truck — Rust CAD Kernel#

Pure Rust B-Rep CAD kernel with WebGPU rendering.

What It Is#

truck is a Rust library for B-Rep (Boundary Representation) solid modeling. It provides:

  • truck-modeling: Geometric primitives, sweeps, boolean operations
  • truck-platform: Scene management, camera, lighting, event loop
  • truck-rendimpl: PBR rendering, instance creation, wireframes
  • truck-meshalgo: Mesh algorithms and tessellation
  • truck-shapeops: Boolean operations (union, subtract, intersect)

How We Use It#

truck is cloned to .src/truck/ as a path dependency. Our crates/truck-webgpu-gui/ crate builds on top of it to create the CAD application.

Key Operations#

Operationtruck API
Create cubebuilder::cube(vertex, edge)
Create spherebuilder::sphere(center, radius, ...)
Create cylinderbuilder::cylinder(bottom, top, radius)
TranslateModify vertex positions in topology
Boolean uniontruck_shapeops::and(solid_a, solid_b)
Boolean subtracttruck_shapeops::or(solid_a, solid_b) (inverted)
Extrude profilebuilder::tsweep(face, vector)
Revolve profilebuilder::rsweep(face, origin, axis, angle)

Serialization#

Solids serialize to JSON via serde. This preserves full B-Rep precision (no tessellation loss).

Source#

Build#

task truck:deps:clone      # Clone to .src/truck/
task truck:build           # Build library
task truck:test            # Run tests
task truck:wasm:build-browser-renderer  # Build WASM for browser