Custom engine utilizing bevy_ecs, wgpu-rs, rapier3d in rust. Bricks snapped together are internally represented as graphs where nodes are bricks and snaps are edges. Graph modification causes a sweep to check if it's connected, to which it subdivides itself when it isn't.
Modern physics engines (PhysX, rapier3d, bullet3d avian, etc) support rigid bodies with many collision shapes, so each graph is a rigid body where each node is a collision shape. Graph subdivision creates new rigid bodies for each graph.