Skip to main content

ProcBrick

Procedural brick assemblies for BrickFlow

Install

pip install procbrick

Sampling requires the assets with the connection atlas (1.11 GiB) and BrickNet's colliders (191 MiB download, 989 MiB extracted), which fetch downloads:

python -m procbrick fetch

Files are stored in procbrick/ in BrickNet's data directory; set BRICKNET_DATA to move it.

Data Structures

ProcBrick samples BrickNet Trees: build orders in which part k + 1 attaches to an earlier part through a typed edge at integer joint coordinates, so every prefix is connected and free of collisions. It stores them as:

  • Trees: a directory of compressed records; any tree, or its first k parts, decodes alone.
  • Renders: trees with print variants and colors, their cameras, and their images.

The atlas holds, for every pair of BrickNet connectors that can mate, the joint coordinates (integer degrees and LDU) at which the two parts' BrickNet colliders do not collide. The sampler draws placements from it. BrickFlow's connectivity energy also uses it to find valid seats.

import bricknet
import procbrick

tree = procbrick.Sampler().sample()                                     # Tree of 100 parts
graph = bricknet.tree_to_graph(tree)                                    # Tree -> Graph

open("tree.txt", "w").write(bricknet.serialize_tree(tree))              # path text
open("tree.ldr", "w").write(bricknet.graph_to_ldr(graph))               # LDraw file
procbrick.save_trees([tree], "trees")                                   # directory of trees

trees = procbrick.load_trees("train/pt", [5, 2], parts=10)              # first 10 parts of trees 5 and 2

renders = procbrick.load_renders("val/procbrick")
tree = renders[0]                                                       # with print variants and colors
open("render.ldr", "w").write(bricknet.graph_to_ldr(bricknet.tree_to_graph(tree)))
open("render.avif", "wb").write(renders.image_bytes(0))                 # RGBA image

Modules:

  • sampler: sampling trees, one at a time or many in parallel
  • trees: reading and writing directories of trees
  • renders: reading and writing renders
  • appearance: print variants and colors of renders
  • catalog: physical classes of parts
  • paths: the data directory and fetch

Command Line

python -m procbrick generate out --count 1000000   # a stopped run resumes

BrickFlow Data

fetch also downloads BrickFlow's splits:

python -m procbrick fetch train/pt        # pretraining: 100,000,000 trees of 100 parts (19.4 GiB)
python -m procbrick fetch train/ic        # image-conditioned finetuning: 1,000,000 renders (100.5 GiB)
python -m procbrick fetch val/procbrick   # evaluation: 9,900 renders (1015 MiB)

Distributions

The figures compare 100,000 sampled trees of 100 parts with the human-designed builds of BrickNet's SFT split. "No rejection" shows stats of samples without the packing and connection-count acceptance.

Hull volume, density, short over long extent, neighbors per part, joins per neighbor pair, and the most common part type's share, at 100 parts:

Volume and density of the first 20, 50, and 100 parts:

Near neighbors per part (parts no connection joins whose colliders come within 0.25 LDU) and the fraction of parts with one, by part count:

Scripts

python scripts/sample.py out --count 4   # trees with ProcBrick's appearance as LDraw files
python scripts/statistics.py --help      # the statistics above

Data

The physical classes of parts ship inside the package. Assets and BrickFlow's splits are on Hugging Face (kulits/BrickFlow). See DATA.md for schemas.

Citation

@InProceedings{kulits2026brickflow,
  author    = {Kulits, Peter and Schmid, Cordelia},
  title     = {BrickFlow: Connectivity-Guided Brick Reconstruction},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2026}
}

Metadata

Release files for procbrick 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for procbrick 0.1.0
File Size Uploaded Provenance Actions
procbrick-0.1.0.tar.gz 263.3 kB Without provenance Details for procbrick-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for procbrick 0.1.0
File Interpreter ABI Platform Actions
procbrick-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for procbrick-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl

Total release size: 1.0 MB

Release files / procbrick-0.1.0.tar.gz

Download URL procbrick-0.1.0.tar.gz
Size 263.3 kB
Tags Source
SHA-256 checksum
How to use checksums
794b2802f34c1116f343f0d3999094375750dabe14a56afc367032ce26ab28fd
BLAKE2b-256 checksum
How to use checksums
9c68d67f8165762991d9a68f9b234f32bd77f2287a50f1d3ff4b15cbf0abcf76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / procbrick-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL procbrick-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 753.4 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
cac8a6c317b8ef66f28afd24daaf37925c2eda2b139adcafc2974ab0159269de
BLAKE2b-256 checksum
How to use checksums
d0d2b46e34d5f6c233c8c8ddb2a2dcd1abee56f19cb4c8624c6c441bdd3c837f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for procbrick 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page