<canvas>
This sketch uses a flow field to place and rotate rectangles. Each rectangle is checked for collisions before placement, so in theory they should either be in free space or fully contained within another rectangle. However, as I’m writing this I see that I have a bug which sometimes allows shapes to span multiple “parent” shapes. Gonna have to track that down.
Tyler Hobbs has a great post where he discusses flow fields at length, including getting into some advanced techniques. I highly recommend it if you want to learn more.