WFC Mesh Slicer for Blender

WFC Mesh Slicer for Blender

A single-file Blender 4.0+ add-on that turns a mesh into Wave Function Collapse–ready modules: slices into cube-aligned cells, analyzes 6-axis neighbor connections, exports to JSON, and reconstructs from JSON.

The add-on adds a WFC Mesh Slicer panel to the 3D Viewport sidebar with four sections: Basic Grid Slicing (N×N×N cells via Intersect/Bisect/Boolean), Snapped Grid Slicing (explicit X/Y/Z cell size, with blocking, modal, optimized-modal, and clearMesh variants), Connection Analysis (walks grid indices, computes 6-axis neighbors, writes wfc_connections_*.json), and Reconstruction (places duplicates from JSON, optional join + auto-solidify).

The snapped-grid operators are modal with an event timer so the UI stays responsive and ESC cancels mid-grid; the optimized variant caches the source mesh as a world-space BMesh and builds a spatial hash for early face-culling. Every boolean apply site catches RuntimeError and retries with the FAST solver.

A standalone Solidify Active Mesh utility implements a 6-pass hybrid interior-face removal pipeline combining Blender's select_interior_faces, a boolean-hack oversized-cube intersect, BMesh duplicate-face dedup, a conservative BVH dual-ray internal-face test, and hole filling — deliberately conservative (refuses to delete >60% of faces) to avoid deleting the outer shell.

Key features

Stack

PythonBlender APIbmeshBVHJSON

← All projects