One Asteroid in Blender and the Browser

Rust compiled to WebAssembly builds this asteroid in your browser. The same Rust code builds it in Blender, through blr.

Move a slider to reshape the asteroid and drag to orbit; Download GLB saves it for Blender (File › Import › glTF 2.0).

In Blender

A small Rust program, built on the upcoming version of blr, asks Blender 5.2 for an icosphere, moves its points with the same recipe, and renders three presets with Cycles, Blender’s path tracer. They match the browser’s asteroids point for point, up to rounding.

let asteroid = Object::new_mesh_primitive_ico_sphere(
    access, params.subdivisions, 1.0, false, [0.0; 3], [0.0; 3], [1.0; 3],
)?;
let mesh: Mesh = asteroid.bind(py).getattr("data")?.extract()?;
let shape = Shape::new(params);
let displaced: Vec<[f32; 3]> =
    mesh.positions(access)?.iter().map(|&p| shape.displace(p)).collect();

The Potato, Battered and Elongated presets, rendered by Cycles in Blender 5.2

To build your own scene in Rust or Python, try the blr playground.