Skip to content
akahmysPublic

About

Sparse 3D volumes in pure Rust: a VDB-style tree with shared topology, zero-copy memory-mappable files, OpenVDB .vdb I/O, and mesh-to-SDF conversion that reports topology changes.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

399 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brodo: Block-sparse Rust Occupancy Data Objects

brodo

Sparse 3D volumes in pure Rust. Store fields over the voxels that matter rather than a whole box, edit where they lie, and save them to files you can read back in place, map from disk, compress, or open in OpenVDB tools. Turn triangle meshes into signed distance fields, and find out whether the voxelisation changed the shape's topology.

  • brodo: the sparse tree, in the style of VDB, with many fields sharing one topology; connected components, the Euler characteristic, dilation and erosion; its own file formats and OpenVDB's .vdb; Hermite data; and a slice as PNG or a field for ParaView, to check a result by eye.
  • colino: reads STL, OBJ and 3MF meshes and converts them to narrow-band signed distance fields and Hermite data on brodo's tree, with a report of the holes, cavities, thin walls and narrow gaps the conversion may have closed or opened.
  • mestolo: a command that shows what a cache file, an archive or a .vdb holds, draws a slice of a grid as PNG, and converts grids to .vdb or .vtu, for someone who writes no Rust.

Each crate's README has an example that runs as a test.

Using it

Depend on the crates from crates.io:

[dependencies]
brodo = "1"
colino = "1"
  • zerocopy 0.8 is a public dependency: a type of your own that a field holds implements brodo::field::Value, whose bounds are zerocopy's traits it derives.
  • They need Rust 1.98 or later, and build for 64-bit, little-endian targets alone, which the frozen layout reads in place. Their tests run on Linux (x86-64), macOS (arm64) and Windows (x86-64) after each push.
  • They follow semantic versioning: a minor version (1.0 to 1.1) adds and a patch version (1.0.0 to 1.0.1) only fixes, and only a major version (1 to 2) breaks what they promise. CHANGELOG.md lists what each release changes and anything it breaks.

Looking inside

A cache file, an archive or a .vdb can be looked at without writing Rust:

cargo install mestolo
mestolo info grids.cache                           # its grids, bounds, values, metadata
mestolo slice grids.cache --grid sdf --axis z --at 0 -o z0.png
mestolo convert grids.cache -o grids.vdb           # every grid but u8 and u32
mestolo convert grids.cache --grid sdf -o sdf.vtu  # one grid, for ParaView

What was checked, and what other tools' documentation says:

  • .vdb: brodo's files are read back by OpenVDB 14.0.0's own tools with every value the same (ADR-0046). Blender imports .vdb files as volume objects, from the Add menu or by dragging them in, and Houdini reads and writes them, as their manuals state; neither has been tried with brodo's files.
  • .vtu: brodo's files are read back by VTK's Python (ARCHITECTURE.md §6.1). ParaView reads VTK's XML unstructured grids, as its reference manual states; it has not been tried with brodo's files.

crates/mestolo/README.md has the rest of mestolo's options.

Documentation

  • The API reference, on docs.rs: brodo, colino and mestolo.

  • What the crates do and promise: ARCHITECTURE.md, its scope in §1, brodo in §4 and colino in §5.

  • The bytes of each file brodo writes, for a reader in another language: docs/formats.md.

  • Where the work is, and what is planned, a viewer among it: ROADMAP.md.

How it is written

brodo is written by a human, its owner, together with AI coding agents: chiefly Claude Code, and Antigravity in support. The owner sets the direction, decides every rule and design question, and approves each release; the agents write code, tests and documents under the rules in AGENTS.md. A change from any of them lands only through the same gate of checks and tests (TESTING.md §4), and each commit Claude Code took part in names it as a co-author.

Issues and pull requests

Issues are welcome: a bug with the steps that show it and the result you expected, or a request for something the crates do not do. One is worked on once the owner labels it owner-approved, and is closed by the owner (AGENTS.md S5). Do not report a vulnerability in a public issue: report it privately, as SECURITY.md says.

Pull requests are not accepted, and only collaborators can open one. brodo is MIT or Apache-2.0, and must hold no code derived from a project under a copyleft licence, not even by translation or from memory (AGENTS.md S1). Of code written elsewhere, that cannot be shown, however good the code, so none is taken: a fix is written here from an issue's steps and expected result, never from code the issue carries (AGENTS.md S5).

Working on brodo

Contributors, human or agent, start with AGENTS.md. To build and test:

cargo build --workspace
cargo test --workspace --all-features

To set up a clone that can land a change:

  1. Install the commit hooks:

    git config core.hooksPath scripts/hooks
  2. Install what the gate needs: rustup (it selects the toolchain pinned in rust-toolchain.toml), cargo-deny, cargo-mutants, cargo-semver-checks and betterleaks at the versions .github/workflows/audit.yml installs, python3 and git; for the fuzzer and Miri, a nightly toolchain, cargo-fuzz and the miri component (TESTING.md §3).

  3. Write the personal rules, which match the owner's name and stay outside the repository (AUDITING.md §2), at ~/.config/betterleaks/personal.toml or $PERSONAL_LEAKS; and the local list of forbidden sources (AGENTS.md S1), one project a line, at ~/.config/brodo/forbidden-sources or $BRODO_FORBIDDEN_SOURCES.

  4. Run the gate:

    ./scripts/audit/verify_compliance.sh

Licence

Licensed under either of MIT or Apache-2.0, at your option.

About

Sparse 3D volumes in pure Rust: a VDB-style tree with shared topology, zero-copy memory-mappable files, OpenVDB .vdb I/O, and mesh-to-SDF conversion that reports topology changes.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages